Spaces:
Running on Zero
Running on Zero
Fix T5 pre-download to include all safetensors files
Browse files
app.py
CHANGED
|
@@ -107,16 +107,24 @@ def preload_model_files():
|
|
| 107 |
print(f"Warning: Could not pre-download Unicalli_Pro: {e}")
|
| 108 |
local_dir = None
|
| 109 |
|
| 110 |
-
# 2. T5 text encoder
|
| 111 |
try:
|
| 112 |
-
snapshot_download(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
print("✓ T5 text encoder cached")
|
| 114 |
except Exception as e:
|
| 115 |
print(f"Warning: Could not pre-download T5: {e}")
|
| 116 |
|
| 117 |
# 3. CLIP text encoder
|
| 118 |
try:
|
| 119 |
-
snapshot_download(
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
print("✓ CLIP text encoder cached")
|
| 121 |
except Exception as e:
|
| 122 |
print(f"Warning: Could not pre-download CLIP: {e}")
|
|
|
|
| 107 |
print(f"Warning: Could not pre-download Unicalli_Pro: {e}")
|
| 108 |
local_dir = None
|
| 109 |
|
| 110 |
+
# 2. T5 text encoder (includes model-00001-of-00002.safetensors, model-00002-of-00002.safetensors)
|
| 111 |
try:
|
| 112 |
+
snapshot_download(
|
| 113 |
+
"XLabs-AI/xflux_text_encoders",
|
| 114 |
+
allow_patterns=["*.safetensors", "*.json", "*.txt", "*.safetensors.index.json"],
|
| 115 |
+
token=hf_token
|
| 116 |
+
)
|
| 117 |
print("✓ T5 text encoder cached")
|
| 118 |
except Exception as e:
|
| 119 |
print(f"Warning: Could not pre-download T5: {e}")
|
| 120 |
|
| 121 |
# 3. CLIP text encoder
|
| 122 |
try:
|
| 123 |
+
snapshot_download(
|
| 124 |
+
"openai/clip-vit-large-patch14",
|
| 125 |
+
allow_patterns=["*.safetensors", "*.json", "*.txt", "*.bin"],
|
| 126 |
+
token=hf_token
|
| 127 |
+
)
|
| 128 |
print("✓ CLIP text encoder cached")
|
| 129 |
except Exception as e:
|
| 130 |
print(f"Warning: Could not pre-download CLIP: {e}")
|