Spaces:
Running on Zero
Running on Zero
Select llama benchmark executable
Browse files
app.py
CHANGED
|
@@ -222,8 +222,8 @@ def _ensure_llama():
|
|
| 222 |
subprocess.check_call(["cmake","-S",src,"-B",bd,"-DLLAMA_NATIVE=ON","-DLLAMA_CUDA=OFF","-DGGML_CUDA=OFF","-DBUILD_SHARED_LIBS=OFF"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
| 223 |
subprocess.check_call(["cmake","--build",bd,"-j",str(nt),"--target","llama-cli","llama-bench"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
| 224 |
import glob as _g
|
| 225 |
-
cands = _g.glob(os.path.join(bd,"**","llama-cli"), recursive=True)
|
| 226 |
-
bench_cands = _g.glob(os.path.join(bd,"**","llama-bench"), recursive=True)
|
| 227 |
if cands:
|
| 228 |
shutil.copy2(cands[0], cli); os.chmod(cli, 0o755)
|
| 229 |
else: raise RuntimeError("llama-cli not found")
|
|
|
|
| 222 |
subprocess.check_call(["cmake","-S",src,"-B",bd,"-DLLAMA_NATIVE=ON","-DLLAMA_CUDA=OFF","-DGGML_CUDA=OFF","-DBUILD_SHARED_LIBS=OFF"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
| 223 |
subprocess.check_call(["cmake","--build",bd,"-j",str(nt),"--target","llama-cli","llama-bench"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
|
| 224 |
import glob as _g
|
| 225 |
+
cands = [p for p in _g.glob(os.path.join(bd,"**","llama-cli"), recursive=True) if os.path.isfile(p)]
|
| 226 |
+
bench_cands = [p for p in _g.glob(os.path.join(bd,"**","llama-bench"), recursive=True) if os.path.isfile(p)]
|
| 227 |
if cands:
|
| 228 |
shutil.copy2(cands[0], cli); os.chmod(cli, 0o755)
|
| 229 |
else: raise RuntimeError("llama-cli not found")
|