Spaces:
Running on Zero
Running on Zero
Diagnose single-thread CPU model loading
Browse files
app.py
CHANGED
|
@@ -304,8 +304,8 @@ def _run_cpu_smoke(model_filter):
|
|
| 304 |
"name": model["name"],
|
| 305 |
"engine": "llama-cli",
|
| 306 |
"gpu_layers": 0,
|
| 307 |
-
"threads":
|
| 308 |
-
"no_mmap":
|
| 309 |
"phases": {},
|
| 310 |
}
|
| 311 |
|
|
@@ -329,7 +329,14 @@ def _run_cpu_smoke(model_filter):
|
|
| 329 |
result["phases"]["download"] = {"ok": False, "elapsed_sec": round(time.time() - t0, 2), "error": str(exc)}
|
| 330 |
return result
|
| 331 |
|
| 332 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 333 |
t0 = time.time()
|
| 334 |
try:
|
| 335 |
run = subprocess.run(command, capture_output=True, text=True, timeout=180, env=env)
|
|
|
|
| 304 |
"name": model["name"],
|
| 305 |
"engine": "llama-cli",
|
| 306 |
"gpu_layers": 0,
|
| 307 |
+
"threads": 1,
|
| 308 |
+
"no_mmap": False,
|
| 309 |
"phases": {},
|
| 310 |
}
|
| 311 |
|
|
|
|
| 329 |
result["phases"]["download"] = {"ok": False, "elapsed_sec": round(time.time() - t0, 2), "error": str(exc)}
|
| 330 |
return result
|
| 331 |
|
| 332 |
+
help_t0 = time.time()
|
| 333 |
+
try:
|
| 334 |
+
help_run = subprocess.run([cli, "--help"], capture_output=True, text=True, timeout=15, env=env)
|
| 335 |
+
result["phases"]["help"] = {"ok": help_run.returncode == 0, "elapsed_sec": round(time.time() - help_t0, 2), "returncode": help_run.returncode}
|
| 336 |
+
except Exception as exc:
|
| 337 |
+
result["phases"]["help"] = {"ok": False, "elapsed_sec": round(time.time() - help_t0, 2), "error": str(exc)}
|
| 338 |
+
|
| 339 |
+
command = [cli, "-m", path, "-t", "1", "-ngl", "0", "-c", "256", "-n", "1", "-p", "Say hi.", "--no-display-prompt", "--no-warmup", "-fa", "0"]
|
| 340 |
t0 = time.time()
|
| 341 |
try:
|
| 342 |
run = subprocess.run(command, capture_output=True, text=True, timeout=180, env=env)
|