Spaces:
Running on Zero
Running on Zero
Add explicit exit code and model verification logging
Browse files
app.py
CHANGED
|
@@ -507,16 +507,23 @@ def _run_benchmark():
|
|
| 507 |
"--no-display-prompt",
|
| 508 |
"--log-disable",
|
| 509 |
]
|
|
|
|
|
|
|
| 510 |
t0 = time.time()
|
| 511 |
-
|
| 512 |
-
|
| 513 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 514 |
wall_time = time.time() - t0
|
| 515 |
output_text = proc.stdout.strip()
|
| 516 |
|
| 517 |
-
|
| 518 |
-
_log(f"Benchmark: {model_info['name']} stdout ({len(output_text)} chars): {output_text[:
|
| 519 |
-
_log(f"Benchmark: {model_info['name']} stderr ({len(proc.stderr)} chars): {proc.stderr[-
|
| 520 |
|
| 521 |
# Parse llama.cpp stderr for timing info
|
| 522 |
# Various formats depending on version:
|
|
|
|
| 507 |
"--no-display-prompt",
|
| 508 |
"--log-disable",
|
| 509 |
]
|
| 510 |
+
_log(f"Benchmark: cmd: {' '.join(cmd[:6])}...")
|
| 511 |
+
_log(f"Benchmark: model exists: {os.path.isfile(model_path)}, size: {os.path.getsize(model_path) if os.path.isfile(model_path) else 0}")
|
| 512 |
t0 = time.time()
|
| 513 |
+
try:
|
| 514 |
+
proc = subprocess.run(
|
| 515 |
+
cmd, capture_output=True, text=True, timeout=300,
|
| 516 |
+
)
|
| 517 |
+
except subprocess.TimeoutExpired:
|
| 518 |
+
result["error"] = "Timeout after 300s"
|
| 519 |
+
results.append(result)
|
| 520 |
+
continue
|
| 521 |
wall_time = time.time() - t0
|
| 522 |
output_text = proc.stdout.strip()
|
| 523 |
|
| 524 |
+
_log(f"Benchmark: {model_info['name']} exit code: {proc.returncode}")
|
| 525 |
+
_log(f"Benchmark: {model_info['name']} stdout ({len(output_text)} chars): {output_text[:300]}")
|
| 526 |
+
_log(f"Benchmark: {model_info['name']} stderr ({len(proc.stderr)} chars): {proc.stderr[-600:]}")
|
| 527 |
|
| 528 |
# Parse llama.cpp stderr for timing info
|
| 529 |
# Various formats depending on version:
|