Spaces:
Paused
Paused
Update main.py
Browse files
main.py
CHANGED
|
@@ -15,8 +15,15 @@ import imageio
|
|
| 15 |
TMP_DIR = "/tmp/space_tmp"
|
| 16 |
os.makedirs(TMP_DIR, exist_ok=True)
|
| 17 |
|
| 18 |
-
# ✅
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
pipeline.cuda()
|
| 21 |
|
| 22 |
# ✅ Preload model (to prevent cold starts)
|
|
|
|
| 15 |
TMP_DIR = "/tmp/space_tmp"
|
| 16 |
os.makedirs(TMP_DIR, exist_ok=True)
|
| 17 |
|
| 18 |
+
# ✅ Define a writable cache directory
|
| 19 |
+
cache_dir = "/tmp/huggingface_cache"
|
| 20 |
+
os.makedirs(cache_dir, exist_ok=True)
|
| 21 |
+
|
| 22 |
+
# ✅ Manually specify cache directory when loading the model
|
| 23 |
+
pipeline = TrellisImageTo3DPipeline.from_pretrained(
|
| 24 |
+
"JeffreyXiang/TRELLIS-image-large",
|
| 25 |
+
cache_dir=cache_dir
|
| 26 |
+
)
|
| 27 |
pipeline.cuda()
|
| 28 |
|
| 29 |
# ✅ Preload model (to prevent cold starts)
|