Spaces:
Sleeping
Sleeping
Commit
·
68a881b
1
Parent(s):
80d11e4
Add delay and verification after model download to handle timing issues
Browse files
app.py
CHANGED
|
@@ -46,6 +46,15 @@ def ensure_weights():
|
|
| 46 |
allow_patterns=["**/*"],
|
| 47 |
token=os.getenv("HF_TOKEN") or os.getenv("HUGGINGFACE_TOKEN"),
|
| 48 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
|
| 51 |
def get_runner() -> SimpleRunner:
|
|
|
|
| 46 |
allow_patterns=["**/*"],
|
| 47 |
token=os.getenv("HF_TOKEN") or os.getenv("HUGGINGFACE_TOKEN"),
|
| 48 |
)
|
| 49 |
+
|
| 50 |
+
# Add a small delay to ensure files are fully written
|
| 51 |
+
import time
|
| 52 |
+
time.sleep(2)
|
| 53 |
+
|
| 54 |
+
# Verify critical files exist
|
| 55 |
+
for file_path in need:
|
| 56 |
+
if not os.path.exists(file_path):
|
| 57 |
+
logger.warning("File %s still not found after download", file_path)
|
| 58 |
|
| 59 |
|
| 60 |
def get_runner() -> SimpleRunner:
|