Spaces:
Running on Zero
Running on Zero
Commit ·
0f4be9d
1
Parent(s): df1fde2
debug: print all HF model repo files to diagnose checkpoint structure
Browse files
app.py
CHANGED
|
@@ -40,15 +40,25 @@ GAME_CONFIG: dict[str, dict] = {
|
|
| 40 |
# ---------------------------------------------------------------------------
|
| 41 |
|
| 42 |
def _download_suite_checkpoints(suite: str) -> Path:
|
| 43 |
-
"""Download
|
| 44 |
suite_dir = MODEL_CACHE_DIR / suite
|
| 45 |
suite_dir.mkdir(exist_ok=True)
|
| 46 |
|
| 47 |
all_files = list(list_repo_files(MODELS_REPO_ID, repo_type="model"))
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
|
| 50 |
if not suite_files:
|
| 51 |
-
raise FileNotFoundError(
|
|
|
|
|
|
|
|
|
|
| 52 |
|
| 53 |
for fname in suite_files:
|
| 54 |
local = MODEL_CACHE_DIR / fname
|
|
|
|
| 40 |
# ---------------------------------------------------------------------------
|
| 41 |
|
| 42 |
def _download_suite_checkpoints(suite: str) -> Path:
|
| 43 |
+
"""Download checkpoint files for a suite from HF. Returns suite_dir."""
|
| 44 |
suite_dir = MODEL_CACHE_DIR / suite
|
| 45 |
suite_dir.mkdir(exist_ok=True)
|
| 46 |
|
| 47 |
all_files = list(list_repo_files(MODELS_REPO_ID, repo_type="model"))
|
| 48 |
+
print(f"[HF] {len(all_files)} files in {MODELS_REPO_ID}:")
|
| 49 |
+
for f in all_files[:30]:
|
| 50 |
+
print(f" {f}")
|
| 51 |
+
|
| 52 |
+
suite_files = [
|
| 53 |
+
f for f in all_files
|
| 54 |
+
if f.startswith(f"{suite}/") and (f.endswith(".pt") or f.endswith(".pth"))
|
| 55 |
+
]
|
| 56 |
|
| 57 |
if not suite_files:
|
| 58 |
+
raise FileNotFoundError(
|
| 59 |
+
f"No checkpoints for suite '{suite}' in {MODELS_REPO_ID}. "
|
| 60 |
+
f"Available files: {all_files[:10]}"
|
| 61 |
+
)
|
| 62 |
|
| 63 |
for fname in suite_files:
|
| 64 |
local = MODEL_CACHE_DIR / fname
|