Trying to run automatic1111 using OpenVINO on private space but encountering error

Hi there I have cloned this space:

Stable Diffusion Protogen x3.4 Web UI - a Hugging Face Space by darkstorm2150

I have changed Dockerfile using ChatGPT to run OpenVINO:

Base image

FROM ubuntu:22.04

Update and install dependencies

RUN apt-get update -y &&
apt-get upgrade -y &&
apt-get install -y libgl1 libglib2.0-0 wget git git-lfs python3-pip python3.10-venv &&
rm -rf /var/lib/apt/lists/*

Clone the OpenVINO repository

RUN git clone GitHub - openvinotoolkit/stable-diffusion-webui: Stable Diffusion web UI /content/stable-diffusion-webui

Change working directory

WORKDIR /content/stable-diffusion-webui

Create and activate virtual environment with proper permissions

RUN python3.10 -m venv /venv &&
/venv/bin/pip install --upgrade pip &&
chown -R 1000:1000 /venv

Set permissions for other directories

RUN chown -R 1000:1000 /content/stable-diffusion-webui

Switch to the new user

USER 1000:1000

Install requirements

COPY requirements.txt /content/stable-diffusion-webui/requirements.txt
RUN /venv/bin/pip install -r requirements.txt

Copy environment patches

ADD ((Link1))
ADD ((Link2))

Apply environment patches

RUN sed -i -e ‘/import image_from_url_text/r /content/env_patch.py’ /content/stable-diffusion-webui/modules/ui.py
RUN sed -i -e ‘/demo:/r /content/header_patch.py’ /content/stable-diffusion-webui/modules/ui.py

Add necessary import of os module in launch.py

RUN sed -i ‘1i import os’ /content/stable-diffusion-webui/launch.py

Remove unnecessary GPU-related code

RUN sed -i -e ‘/prepare_environment()/a\ os.system(f"““sed -i -e ‘’“s/dict()))/dict())).cpu()/g”” /content/stable-diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/util.py”“”)’ /content/stable-diffusion-webui/launch.py
RUN sed -i -e ‘s/ start()/ #start()/g’ /content/stable-diffusion-webui/launch.py

Adjust WebUI settings

RUN sed -i -e ‘/(modelmerger_interface, "Checkpoint Merger", "modelmerger"),/d’ /content/stable-diffusion-webui/modules/ui.py
RUN sed -i -e ‘/(train_interface, "Train", "ti"),/d’ /content/stable-diffusion-webui/modules/ui.py
RUN sed -i -e ‘/extensions_interface, "Extensions", "extensions"/d’ /content/stable-diffusion-webui/modules/ui.py
RUN sed -i -e ‘/settings_interface, "Settings", "settings"/d’ /content/stable-diffusion-webui/modules/ui.py
RUN sed -i -e “s/document.getElementsByTagName(‘gradio-app’)[0].shadowRoot/!!document.getElementsByTagName(‘gradio-app’)[0].shadowRoot ? document.getElementsByTagName(‘gradio-app’)[0].shadowRoot : document/g” /content/stable-diffusion-webui/script.js
RUN sed -i -e ‘s/ show_progress=False,/ show_progress=True,/g’ /content/stable-diffusion-webui/modules/ui.py
RUN sed -i -e ‘s/default_enabled=False/default_enabled=True/g’ /content/stable-diffusion-webui/webui.py
RUN sed -i -e ‘s/ outputs=[/queue=False, &/g’ /content/stable-diffusion-webui/modules/ui.py
RUN sed -i -e ‘s/ queue=False, / /g’ /content/stable-diffusion-webui/modules/ui.py

Copy configuration files

ADD ((Link3))
ADD ((Link4))
ADD ((Link5))

Expose port

EXPOSE 7860

Launch the WebUI

CMD [“/bin/bash”, “./webui.sh”, “–skip-torch-cuda-test”, “–precision”, “full”, “–no-half”]

And the runtime error I am encountering is:

===== Application Startup at 2024-05-01 15:58:51 =====


################################################################
Install script for stable-diffusion + Web UI
Tested on Debian 11 (Bullseye)
################################################################

################################################################
whoami: cannot find name for user ID 1000
Running on  user
################################################################

################################################################
Repo already cloned, using it as install directory
################################################################

################################################################
Create and activate python venv
################################################################

################################################################
Launching launch.py...
################################################################
Cannot locate TCMalloc (improves CPU memory usage)
fatal: No names found, cannot describe anything.
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
Version: 1.6.0
Commit hash: 44006297e03a07f28505d54d6ba5fd55e0c1292d
Installing torch and torchvision
WARNING: The directory '/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu118
Collecting torch==2.0.1
 Downloading https://download.pytorch.org/whl/cu118/torch-2.0.1%2Bcu118-cp310-cp310-linux_x86_64.whl (2267.3 MB)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.3/2.3 GB 370.2 MB/s eta 0:00:00
Collecting torchvision==0.15.2
 Downloading https://download.pytorch.org/whl/cu118/torchvision-0.15.2%2Bcu118-cp310-cp310-linux_x86_64.whl (6.1 MB)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.1/6.1 MB 202.4 MB/s eta 0:00:00
Collecting typing-extensions
 Downloading typing_extensions-4.11.0-py3-none-any.whl (34 kB)
Collecting sympy
 Downloading https://download.pytorch.org/whl/sympy-1.12-py3-none-any.whl (5.7 MB)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.7/5.7 MB 340.9 MB/s eta 0:00:00
Collecting networkx
 Downloading networkx-3.3-py3-none-any.whl (1.7 MB)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.7/1.7 MB 98.1 MB/s eta 0:00:00
Collecting triton==2.0.0
 Downloading https://download.pytorch.org/whl/triton-2.0.0-1-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (63.3 MB)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 63.3/63.3 MB 365.0 MB/s eta 0:00:00
Collecting jinja2
 Downloading https://download.pytorch.org/whl/Jinja2-3.1.3-py3-none-any.whl (133 kB)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.2/133.2 KB 373.7 MB/s eta 0:00:00
Collecting filelock
 Downloading filelock-3.14.0-py3-none-any.whl (12 kB)
Collecting numpy
 Downloading numpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.2/18.2 MB 356.0 MB/s eta 0:00:00
Collecting pillow!=8.3.*,>=5.3.0
 Downloading pillow-10.3.0-cp310-cp310-manylinux_2_28_x86_64.whl (4.5 MB)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.5/4.5 MB 282.4 MB/s eta 0:00:00
Collecting requests
 Downloading requests-2.31.0-py3-none-any.whl (62 kB)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.6/62.6 KB 306.1 MB/s eta 0:00:00
Collecting lit
 Downloading lit-18.1.4-py3-none-any.whl (96 kB)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 96.4/96.4 KB 278.0 MB/s eta 0:00:00
Collecting cmake
 Downloading cmake-3.29.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (26.7 MB)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 26.7/26.7 MB 217.9 MB/s eta 0:00:00
Collecting MarkupSafe>=2.0
 Downloading https://download.pytorch.org/whl/MarkupSafe-2.1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (25 kB)
Collecting charset-normalizer<4,>=2
 Downloading charset_normalizer-3.3.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (142 kB)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 142.1/142.1 KB 341.5 MB/s eta 0:00:00
Collecting urllib3<3,>=1.21.1
 Downloading urllib3-2.2.1-py3-none-any.whl (121 kB)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 121.1/121.1 KB 319.4 MB/s eta 0:00:00
Collecting idna<4,>=2.5
 Downloading idna-3.7-py3-none-any.whl (66 kB)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 66.8/66.8 KB 240.7 MB/s eta 0:00:00
Collecting certifi>=2017.4.17
 Downloading certifi-2024.2.2-py3-none-any.whl (163 kB)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 163.8/163.8 KB 388.4 MB/s eta 0:00:00
Collecting mpmath>=0.19
 Downloading https://download.pytorch.org/whl/mpmath-1.3.0-py3-none-any.whl (536 kB)
    ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 536.2/536.2 KB 404.1 MB/s eta 0:00:00
Installing collected packages: mpmath, lit, urllib3, typing-extensions, sympy, pillow, numpy, networkx, MarkupSafe, idna, filelock, cmake, charset-normalizer, certifi, requests, jinja2, triton, torch, torchvision
Successfully installed MarkupSafe-2.1.5 certifi-2024.2.2 charset-normalizer-3.3.2 cmake-3.29.2 filelock-3.14.0 idna-3.7 jinja2-3.1.3 lit-18.1.4 mpmath-1.3.0 networkx-3.3 numpy-1.26.4 pillow-10.3.0 requests-2.31.0 sympy-1.12 torch-2.0.1+cu118 torchvision-0.15.2+cu118 triton-2.0.0 typing-extensions-4.11.0 urllib3-2.2.1
Installing clip
Installing open_clip
Cloning Stable Diffusion into /content/stable-diffusion-webui/repositories/stable-diffusion-stability-ai...
Cloning into '/content/stable-diffusion-webui/repositories/stable-diffusion-stability-ai'...
Cloning Stable Diffusion XL into /content/stable-diffusion-webui/repositories/generative-models...
Cloning into '/content/stable-diffusion-webui/repositories/generative-models'...
Cloning K-diffusion into /content/stable-diffusion-webui/repositories/k-diffusion...
Cloning into '/content/stable-diffusion-webui/repositories/k-diffusion'...
Cloning CodeFormer into /content/stable-diffusion-webui/repositories/CodeFormer...
Cloning into '/content/stable-diffusion-webui/repositories/CodeFormer'...
Cloning BLIP into /content/stable-diffusion-webui/repositories/BLIP...
Cloning into '/content/stable-diffusion-webui/repositories/BLIP'...
Installing requirements for CodeFormer
Installing requirements
sh: 1: Syntax error: Unterminated quoted string

Kindly help me to resolve this error and I am a beginner. Thanks

All the above marked missing links are :point_down:t2:

Link1: https://github.com/camenduru/webui-docker/raw/main/env_patch.py /content/env_patch.py

Link2: https://raw.githubusercontent.com/darkstorm2150/webui/main/header_patch.py /content/header_patch.py

Link3: https://github.com/camenduru/webui-docker/raw/main/shared-config.json /content/shared-config.json

Link4: https://github.com/camenduru/webui-docker/raw/main/shared-ui-config.json /content/shared-ui-config.json

Link5: https://huggingface.co/darkstorm2150/Protogen_x3.4_Official_Release/resolve/main/ProtoGen_X3.4.safetensors /content/stable-diffusion-webui/models/Stable-diffusion/ProtoGen_X3.4.safetensors

Sorry for all links like this in reply, because it doesn’t all new user to send more than 2 links😅

Thanks

@freddyaboulton can you help please