Spaces:
Runtime error
Runtime error
Update app.py
Browse filesFixing nameError for xformers module
app.py
CHANGED
@@ -3,7 +3,7 @@ from subprocess import getoutput
|
|
3 |
|
4 |
gpu_info = getoutput('nvidia-smi')
|
5 |
if("A10G" in gpu_info):
|
6 |
-
os.system(
|
7 |
elif("T4" in gpu_info):
|
8 |
os.system(f"pip install -q https://github.com/camenduru/stable-diffusion-webui-colab/releases/download/0.0.15/xformers-0.0.15.dev0+1515f77.d20221130-cp38-cp38-linux_x86_64.whl")
|
9 |
|
@@ -11,11 +11,9 @@ os.system(f"git clone https://github.com/camenduru/stable-diffusion-webui /home/
|
|
11 |
os.chdir("/home/user/app/stable-diffusion-webui")
|
12 |
|
13 |
os.system(f"wget -q https://github.com/camenduru/webui/raw/main/env_patch.py -O /home/user/app/env_patch.py")
|
|
|
|
|
14 |
|
15 |
-
# Add xformers imports to env_patch.py
|
16 |
-
os.system(f'''echo -e "import xformers\\nimport xformers.ops\\n" | cat - /home/user/app/env_patch.py > temp && mv temp /home/user/app/env_patch.py''')
|
17 |
-
|
18 |
-
os.system(f"sed -i -e '/import image_from_url_text/r /home/user/app/env_patch.py' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
19 |
os.system(f"sed -i -e '/(modelmerger_interface, \"Checkpoint Merger\", \"modelmerger\"),/d' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
20 |
os.system(f"sed -i -e '/(train_interface, \"Train\", \"ti\"),/d' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
21 |
os.system(f"sed -i -e '/extensions_interface, \"Extensions\", \"extensions\"/d' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
|
|
3 |
|
4 |
gpu_info = getoutput('nvidia-smi')
|
5 |
if("A10G" in gpu_info):
|
6 |
+
os.system("pip install -q xformers==0.0.24.post1+cu121torch2.1 -f https://nenejjj.github.io/whl/")
|
7 |
elif("T4" in gpu_info):
|
8 |
os.system(f"pip install -q https://github.com/camenduru/stable-diffusion-webui-colab/releases/download/0.0.15/xformers-0.0.15.dev0+1515f77.d20221130-cp38-cp38-linux_x86_64.whl")
|
9 |
|
|
|
11 |
os.chdir("/home/user/app/stable-diffusion-webui")
|
12 |
|
13 |
os.system(f"wget -q https://github.com/camenduru/webui/raw/main/env_patch.py -O /home/user/app/env_patch.py")
|
14 |
+
os.system(f'''sed -i "/import image_from_url_text/a import xformers\\nimport xformers.ops" /home/user/app/stable-diffusion-webui/modules/ui.py''')
|
15 |
+
os.system(f'''sed -i -e '/import image_from_url_text/r /home/user/app/env_patch.py' /home/user/app/stable-diffusion-webui/modules/ui.py''')
|
16 |
|
|
|
|
|
|
|
|
|
17 |
os.system(f"sed -i -e '/(modelmerger_interface, \"Checkpoint Merger\", \"modelmerger\"),/d' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
18 |
os.system(f"sed -i -e '/(train_interface, \"Train\", \"ti\"),/d' /home/user/app/stable-diffusion-webui/modules/ui.py")
|
19 |
os.system(f"sed -i -e '/extensions_interface, \"Extensions\", \"extensions\"/d' /home/user/app/stable-diffusion-webui/modules/ui.py")
|