Spaces:
Running on Zero
Running on Zero
Fix torch/torchao/torchvision versions for spaces.aoti_capture
Browse files- spaces.aoti_capture requires PyTorch 2.8+
- Install torch>=2.8,<2.9 with matching torchvision>=0.23,<0.24
- Install torchao at runtime (compatible with torch 2.8)
- app.py +4 -3
- requirements.txt +2 -2
app.py
CHANGED
|
@@ -4,10 +4,11 @@ Gradio Demo for Chinese Calligraphy Generation - HuggingFace Space Version
|
|
| 4 |
With Float8 quantization and AOT compilation for faster inference
|
| 5 |
"""
|
| 6 |
|
| 7 |
-
# Install compatible torch + torchvision +
|
|
|
|
| 8 |
import os
|
| 9 |
-
os.system('pip install --upgrade --pre --extra-index-url https://download.pytorch.org/whl/nightly/cu126 "torch<2.9" "torchvision<0.
|
| 10 |
-
print("torch + torchvision + spaces installation complete!")
|
| 11 |
|
| 12 |
# IMPORTANT: import spaces first before any CUDA-related packages
|
| 13 |
import spaces
|
|
|
|
| 4 |
With Float8 quantization and AOT compilation for faster inference
|
| 5 |
"""
|
| 6 |
|
| 7 |
+
# Install compatible torch 2.8 + torchvision 0.23 + torchao + spaces (for AOT compilation)
|
| 8 |
+
# spaces.aoti_capture requires PyTorch 2.8+
|
| 9 |
import os
|
| 10 |
+
os.system('pip install --upgrade --pre --extra-index-url https://download.pytorch.org/whl/nightly/cu126 "torch>=2.8,<2.9" "torchvision>=0.23,<0.24" torchao spaces')
|
| 11 |
+
print("torch 2.8 + torchvision 0.23 + torchao + spaces installation complete!")
|
| 12 |
|
| 13 |
# IMPORTANT: import spaces first before any CUDA-related packages
|
| 14 |
import spaces
|
requirements.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
# AOT compilation dependencies
|
| 2 |
-
torchao
|
| 3 |
transformers
|
| 4 |
git+https://github.com/huggingface/diffusers.git
|
| 5 |
accelerate
|
|
|
|
| 1 |
+
# AOT compilation dependencies
|
| 2 |
+
# torchao is installed at runtime with torch 2.8 compatible version (see app.py)
|
| 3 |
transformers
|
| 4 |
git+https://github.com/huggingface/diffusers.git
|
| 5 |
accelerate
|