Spaces:
Running on Zero
Running on Zero
Upload folder using huggingface_hub
Browse files- app.py +2 -1
- requirements.txt +4 -1
app.py
CHANGED
|
@@ -5,7 +5,8 @@ using Microsoft's Mage-Flow model (Turbo variants for fast inference).
|
|
| 5 |
"""
|
| 6 |
import os
|
| 7 |
|
| 8 |
-
|
|
|
|
| 9 |
|
| 10 |
import spaces # MUST be first (after env setup)
|
| 11 |
import torch
|
|
|
|
| 5 |
"""
|
| 6 |
import os
|
| 7 |
|
| 8 |
+
# Use flash_attention_2 for the HF text encoder (flash_attn is installed via wheel)
|
| 9 |
+
os.environ.setdefault("VF_HF_ATTN_IMPL", "flash_attention_2")
|
| 10 |
|
| 11 |
import spaces # MUST be first (after env setup)
|
| 12 |
import torch
|
requirements.txt
CHANGED
|
@@ -11,4 +11,7 @@ pydantic>=2.0
|
|
| 11 |
pillow>=10.0
|
| 12 |
numpy>=1.26
|
| 13 |
loguru>=0.7.0
|
| 14 |
-
typing_extensions>=4.0
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
pillow>=10.0
|
| 12 |
numpy>=1.26
|
| 13 |
loguru>=0.7.0
|
| 14 |
+
typing_extensions>=4.0
|
| 15 |
+
|
| 16 |
+
# Flash Attention 2 (prebuilt Blackwell sm_120 wheel)
|
| 17 |
+
https://huggingface.co/datasets/multimodalart/zerogpu-blackwell-wheels/resolve/main/wheels/pt211-cu130-cp312/flash_attn-2.8.3-cp312-cp312-linux_x86_64.whl
|