Spaces:
Running on Zero
Running on Zero
Bobby commited on
Commit ·
3af3570
1
Parent(s): 89bc1ad
Prefer xformers attention and remove flash-attn dependency
Browse files- app.py +3 -3
- requirements.txt +1 -1
app.py
CHANGED
|
@@ -9,10 +9,10 @@ from typing import Any, Dict, Generator, List, Optional, Tuple
|
|
| 9 |
|
| 10 |
os.environ["OPENCV_IO_ENABLE_OPENEXR"] = "1"
|
| 11 |
os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:True"
|
| 12 |
-
if importlib.util.find_spec("
|
| 13 |
-
_attn_backend = "flash_attn"
|
| 14 |
-
elif importlib.util.find_spec("xformers") is not None:
|
| 15 |
_attn_backend = "xformers"
|
|
|
|
|
|
|
| 16 |
else:
|
| 17 |
_attn_backend = "sdpa"
|
| 18 |
os.environ.setdefault("ATTN_BACKEND", _attn_backend)
|
|
|
|
| 9 |
|
| 10 |
os.environ["OPENCV_IO_ENABLE_OPENEXR"] = "1"
|
| 11 |
os.environ["PYTORCH_CUDA_ALLOC_CONF"] = "expandable_segments:True"
|
| 12 |
+
if importlib.util.find_spec("xformers") is not None:
|
|
|
|
|
|
|
| 13 |
_attn_backend = "xformers"
|
| 14 |
+
elif importlib.util.find_spec("flash_attn") is not None:
|
| 15 |
+
_attn_backend = "flash_attn"
|
| 16 |
else:
|
| 17 |
_attn_backend = "sdpa"
|
| 18 |
os.environ.setdefault("ATTN_BACKEND", _attn_backend)
|
requirements.txt
CHANGED
|
@@ -17,9 +17,9 @@ zstandard==0.25.0
|
|
| 17 |
kornia==0.8.2
|
| 18 |
timm==1.0.22
|
| 19 |
pydantic==2.10.6
|
|
|
|
| 20 |
gradio_litmodel3d==0.0.1
|
| 21 |
git+https://github.com/EasternJournalist/utils3d.git@9a4eb15e4021b67b12c460c7057d642626897ec8
|
| 22 |
-
https://github.com/Dao-AILab/flash-attention/releases/download/v2.7.0.post2/flash_attn-2.7.0.post2+cu12torch2.4cxx11abiFALSE-cp310-cp310-linux_x86_64.whl
|
| 23 |
https://github.com/JeffreyXiang/Storages/releases/download/Space_Wheels_251210/cumesh-0.0.1-cp310-cp310-linux_x86_64.whl
|
| 24 |
https://github.com/JeffreyXiang/Storages/releases/download/Space_Wheels_251210/flex_gemm-0.0.1-cp310-cp310-linux_x86_64.whl
|
| 25 |
https://github.com/JeffreyXiang/Storages/releases/download/Space_Wheels_251210/o_voxel-0.0.1-cp310-cp310-linux_x86_64.whl
|
|
|
|
| 17 |
kornia==0.8.2
|
| 18 |
timm==1.0.22
|
| 19 |
pydantic==2.10.6
|
| 20 |
+
xformers==0.0.27.post2
|
| 21 |
gradio_litmodel3d==0.0.1
|
| 22 |
git+https://github.com/EasternJournalist/utils3d.git@9a4eb15e4021b67b12c460c7057d642626897ec8
|
|
|
|
| 23 |
https://github.com/JeffreyXiang/Storages/releases/download/Space_Wheels_251210/cumesh-0.0.1-cp310-cp310-linux_x86_64.whl
|
| 24 |
https://github.com/JeffreyXiang/Storages/releases/download/Space_Wheels_251210/flex_gemm-0.0.1-cp310-cp310-linux_x86_64.whl
|
| 25 |
https://github.com/JeffreyXiang/Storages/releases/download/Space_Wheels_251210/o_voxel-0.0.1-cp310-cp310-linux_x86_64.whl
|