BlueSkyXN commited on
Commit ·
f01b4c0
1
Parent(s): b7f1562
Improve DiffusionGemma Space runtime diagnostics
Browse filesFiles changed (6)
- DEPLOY.md+17-1
- README.md+29-3
- app.py+108-1
- scripts/build_llama_diffusion.sh+43-2
- src/prepare.py+74-1
- src/runner.py+5
40 unmodified lines41424344454610 unmodified lines57585960616224 unmodified lines87888990919293949540 unmodified linesMAX_MAX_TOKENS=2048```Recommended with persistent storage:```text10 unmodified lines```bashcurl "$SPACE_URL/health"```Then use the Gradio queue endpoint:24 unmodified linesnvcc not foundCMake cannot find CUDAGGML_CUDA failed```Then switch to a prebuilt binary:```textBUILD_LLAMA_DIFFUSION=040 unmodified lines414243444546474849505152535455565710 unmodified lines686970717273747524 unmodified lines10010110210310410510610710810911011140 unmodified linesMAX_MAX_TOKENS=2048```The qwen36 reference Space avoids runtime CUDA build drift by setting a prebuiltrunner URL and preparing it on startup. For this DiffusionGemma Space, use thesame pattern once a tested `llama-diffusion-cli` package is available:```textBUILD_LLAMA_DIFFUSION=0LLAMA_DIFFUSION_BIN_URL=https://.../llama-diffusion-cli-linux-cuda-package.tar.gzPREPARE_RUNTIME_ON_STARTUP=1DOWNLOAD_MODEL_ON_STARTUP=1```Recommended with persistent storage:```text10 unmodified lines```bashcurl "$SPACE_URL/health"curl "$SPACE_URL/v2/runtime"curl "$SPACE_URL/v2/zerogpu/probe"```Then use the Gradio queue endpoint:24 unmodified linesnvcc not foundCMake cannot find CUDAGGML_CUDA failedundefined reference to `cuda...@libcudart.so````The build script adds NVIDIA Python package library paths and installs sibling`.so` files next to `llama-diffusion-cli`. If CUDA linking still fails, switchto a prebuilt binary:```textBUILD_LLAMA_DIFFUSION=0
29 unmodified lines30313233343537 unmodified lines73747576777831 unmodified lines11011111211311411511681 unmodified lines19819920020120220320420529 unmodified linesllama-diffusion-cli subprocess/v1/models/v1/chat/completions```The first version is **text-only** and **final-only**. `stream=true` is supported as a compatibility shim: it sends the final result as one OpenAI-style delta, not token-by-token streaming.37 unmodified linesGRADIO_SSR_MODE=false```If you attach persistent storage:```text31 unmodified linesLLAMA_BUILD_CUDA=1```Building inside the Space is convenient for the first test, but it is the least deterministic option. A prebuilt binary is preferable once you know which `llama.cpp` PR revision works.## API usage81 unmodified lines6. Deploy.7. Inspect logs for `llama-diffusion-cli` build success.8. Call `/health`.9. Run `scripts/call_space_direct.sh`.10. Then test `/v1/chat/completions`.## Known limitations29 unmodified lines30313233343536373837 unmodified lines767778798081828384858687888990919231 unmodified lines12412512612712812913013113213313413513613713813914014181 unmodified lines22322422522622722822923023129 unmodified linesllama-diffusion-cli subprocess/v1/models/v1/chat/completions/v2/runtime/v2/logs/v2/zerogpu/probe```The first version is **text-only** and **final-only**. `stream=true` is supported as a compatibility shim: it sends the final result as one OpenAI-style delta, not token-by-token streaming.37 unmodified linesGRADIO_SSR_MODE=false```The qwen36 reference Space is stable because it uses a prebuilt CUDA runnerpackage through `LLAMA_CLI_URL` and prepares it on startup. Use the same strategyfor DiffusionGemma once you have a tested `llama-diffusion-cli` package:```textBUILD_LLAMA_DIFFUSION=0LLAMA_DIFFUSION_BIN_URL=https://.../llama-diffusion-cli-linux-cuda-package.tar.gzPREPARE_RUNTIME_ON_STARTUP=1DOWNLOAD_MODEL_ON_STARTUP=1```If you attach persistent storage:```text31 unmodified linesLLAMA_BUILD_CUDA=1```Building inside the Space is convenient for the first test, but it is the least deterministic option. The build script adds NVIDIA Python package library paths for CUDA/cuBLAS linking and copies sibling shared libraries next to `llama-diffusion-cli`, but a prebuilt binary package is still preferable once you know which `llama.cpp` PR revision works.## Diagnostics```textGET /v2/runtimeGET /v2/logsGET /v2/zerogpu/probeGET /v2/zerogpu/probe?cli=1````/v2/zerogpu/probe` runs inside `@spaces.GPU` and is the direct way to confirm that ZeroGPU allocated a CUDA device. `?cli=1` probes the runner only if `llama-diffusion-cli` already exists; it does not trigger a build by itself.## API usage81 unmodified lines6. Deploy.7. Inspect logs for `llama-diffusion-cli` build success.8. Call `/health`.9. Call `/v2/runtime` and `/v2/zerogpu/probe`.10. Run `scripts/call_space_direct.sh`.11. Then test `/v1/chat/completions`.## Known limitations
29 unmodified lines30313233343513 unmodified lines4950515253545564 unmodified lines12012112212312412529 unmodified linesimport jsonimport osimport threadingimport timeimport uuid13 unmodified linesmake_sse_chunk,make_sse_done,)from src.prepare import prepare_runtime_if_requested, runtime_statusprepare_runtime_if_requested()64 unmodified linesreturn {"object": "list", "data": public_model_list()}@app.post("/v1/chat/completions")async def v1_chat_completions(request: Request):"""OpenAI-compatible convenience route.29 unmodified lines303132333435363713 unmodified lines5152535455565764 unmodified lines12212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123229 unmodified linesimport jsonimport osimport shleximport subprocessimport threadingimport timeimport uuid13 unmodified linesmake_sse_chunk,make_sse_done,)from src.prepare import prepare_runtime_if_requested, runtime_events, runtime_statusprepare_runtime_if_requested()64 unmodified linesreturn {"object": "list", "data": public_model_list()}def _probe_command(cmd: list[str], timeout: int = 12) -> dict[str, Any]:try:proc = subprocess.run(cmd,text=True,capture_output=True,timeout=timeout,check=False,)return {"cmd": shlex.join(cmd),"returncode": proc.returncode,"stdout_tail": (proc.stdout or "")[-2000:],"stderr_tail": (proc.stderr or "")[-2000:],}except Exception as exc: # noqa: BLE001 - diagnostic endpointreturn {"cmd": shlex.join(cmd), "error": str(exc)}@spaces.GPU(size=settings.zero_gpu_size, duration=60)def _gpu_probe(include_cli: bool = False) -> dict[str, Any]:diagnostics = [_probe_command(["nvidia-smi", "-L"]),_probe_command(["nvidia-smi"]),_probe_command(["bash", "-lc", "printf 'CUDA_VISIBLE_DEVICES=%s\\nLD_LIBRARY_PATH=%s\\n' \"$CUDA_VISIBLE_DEVICES\" \"$LD_LIBRARY_PATH\""]),_probe_command(["bash","-lc","ls -l ${CUDA_HOME:-/usr/local/cuda}/lib64/libcudart.so* ""${CUDA_HOME:-/usr/local/cuda}/lib64/libcublas.so* ""/usr/local/lib/python*/site-packages/nvidia/*/lib/libcudart.so* ""/usr/local/lib/python*/site-packages/nvidia/*/lib/libcublas.so* 2>/dev/null || true",]),]cli_result = Noneif include_cli and settings.llama_diffusion_bin.exists():cli_result = _probe_command([str(settings.llama_diffusion_bin), "--help"])return {"ok": True,"cuda_visible_devices": os.getenv("CUDA_VISIBLE_DEVICES", ""),"diagnostics": diagnostics,"llama_diffusion_cli_probe": cli_result,"note": "This endpoint runs inside @spaces.GPU; a MIG value in CUDA_VISIBLE_DEVICES means ZeroGPU allocation is active.",}@app.get("/v2")async def v2_index() -> dict[str, Any]:return {"object": "api.catalog","endpoints": [{"method": "GET", "path": "/health"},{"method": "GET", "path": "/v1/models"},{"method": "GET", "path": "/v2/runtime"},{"method": "GET", "path": "/v2/logs"},{"method": "GET", "path": "/v2/zerogpu/probe"},{"method": "POST", "path": "/v1/chat/completions"},{"method": "POST", "path": "/gradio_api/call/chat"},],"default_model": default_model_id(),}@app.get("/v2/runtime")async def v2_runtime() -> dict[str, Any]:return {"ok": True,"service": "diffusiongemma-gguf-zerogpu-api","default_model": default_model_id(),"zero_gpu_size": settings.zero_gpu_size,"runtime": runtime_status(),"limits": {"default_max_tokens": settings.default_max_tokens,"max_max_tokens": settings.max_max_tokens,"diffusion_max_steps": settings.diffusion_max_steps,"api_time_limit_seconds": settings.api_time_limit_seconds,"cli_timeout_seconds": settings.cli_timeout_seconds,},"build": {"build_llama_diffusion": settings.build_llama_diffusion,"llama_build_cuda": settings.llama_build_cuda,"llama_cmake_extra_args": settings.llama_cmake_extra_args,"llama_diffusion_bin_url": bool(settings.llama_diffusion_bin_url),},"paths": {"data_dir": str(settings.data_dir),"model_cache_dir": str(settings.model_cache_dir),"bin_dir": str(settings.bin_dir),"llama_src_dir": str(settings.llama_src_dir),},}@app.get("/v2/logs")async def v2_logs(limit: int = 100) -> dict[str, Any]:return {"object": "event.list", "data": runtime_events(limit)}@app.get("/v2/zerogpu/probe")async def v2_zerogpu_probe(request: Request) -> dict[str, Any]:include_cli = str(request.query_params.get("cli", "")).lower() in {"1", "true", "yes", "on"}return _gpu_probe(include_cli=include_cli)@app.post("/v1/chat/completions")async def v1_chat_completions(request: Request):"""OpenAI-compatible convenience route.
5 unmodified lines6789101119 unmodified lines3132333435361 unmodified line38394041424344454647484950515 unmodified linesLLAMA_DIFFUSION_BIN="${LLAMA_DIFFUSION_BIN:-${LLAMA_BIN_DIR}/llama-diffusion-cli}"LLAMA_BUILD_CUDA="${LLAMA_BUILD_CUDA:-1}"LLAMA_CMAKE_EXTRA_ARGS="${LLAMA_CMAKE_EXTRA_ARGS:-}"mkdir -p "${LLAMA_BIN_DIR}"19 unmodified linesCMAKE_ARGS+=("-DGGML_CUDA=ON")fiif [[ -n "${LLAMA_CMAKE_EXTRA_ARGS}" ]]; then# shellcheck disable=SC2206EXTRA_ARGS=( ${LLAMA_CMAKE_EXTRA_ARGS} )1 unmodified linefiecho "[build] cmake args: ${CMAKE_ARGS[*]}"cmake -B build "${CMAKE_ARGS[@]}"cmake --build build -j "$(nproc)" --config Release --target llama-diffusion-cliif [[ ! -x build/bin/llama-diffusion-cli ]]; thenecho "[build] build/bin/llama-diffusion-cli was not produced" >&2exit 1ficp build/bin/llama-diffusion-cli "${LLAMA_DIFFUSION_BIN}"chmod +x "${LLAMA_DIFFUSION_BIN}"echo "[build] Installed ${LLAMA_DIFFUSION_BIN}"5 unmodified lines6789101112131419 unmodified lines3435363738394041424344454647484950515253545556575859606162636465666768697071727374751 unmodified line777879808182838485868788899091925 unmodified linesLLAMA_DIFFUSION_BIN="${LLAMA_DIFFUSION_BIN:-${LLAMA_BIN_DIR}/llama-diffusion-cli}"LLAMA_BUILD_CUDA="${LLAMA_BUILD_CUDA:-1}"LLAMA_CMAKE_EXTRA_ARGS="${LLAMA_CMAKE_EXTRA_ARGS:-}"LLAMA_CMAKE_EXE_LINKER_FLAGS="${LLAMA_CMAKE_EXE_LINKER_FLAGS:-}"LLAMA_CMAKE_SHARED_LINKER_FLAGS="${LLAMA_CMAKE_SHARED_LINKER_FLAGS:-}"CMAKE_BUILD_PARALLEL="${CMAKE_BUILD_PARALLEL:-$(nproc)}"mkdir -p "${LLAMA_BIN_DIR}"19 unmodified linesCMAKE_ARGS+=("-DGGML_CUDA=ON")fiNVIDIA_LIB_DIRS=()while IFS= read -r lib_dir; do[[ -n "${lib_dir}" && -d "${lib_dir}" ]] && NVIDIA_LIB_DIRS+=("${lib_dir}")done < <(python - <<'PY'from pathlib import Pathimport siteseen = set()for root in [*site.getsitepackages(), site.getusersitepackages()]:if not root:continuebase = Path(root) / "nvidia"if not base.exists():continuefor path in base.glob("*/lib"):if path.is_dir():value = str(path)if value not in seen:seen.add(value)print(value)PY)if [[ "${#NVIDIA_LIB_DIRS[@]}" -gt 0 ]]; thenNVIDIA_LD_PATH="$(IFS=:; echo "${NVIDIA_LIB_DIRS[*]}")"export LD_LIBRARY_PATH="${NVIDIA_LD_PATH}${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"LINK_FLAGS=""for lib_dir in "${NVIDIA_LIB_DIRS[@]}"; doLINK_FLAGS+=" -L${lib_dir} -Wl,-rpath,${lib_dir} -Wl,-rpath-link,${lib_dir}"doneLINK_FLAGS+=" -Wl,--allow-shlib-undefined"CMAKE_ARGS+=("-DCMAKE_EXE_LINKER_FLAGS=${LINK_FLAGS} ${LLAMA_CMAKE_EXE_LINKER_FLAGS}")CMAKE_ARGS+=("-DCMAKE_SHARED_LINKER_FLAGS=${LINK_FLAGS} ${LLAMA_CMAKE_SHARED_LINKER_FLAGS}")fiif [[ -n "${LLAMA_CMAKE_EXTRA_ARGS}" ]]; then# shellcheck disable=SC2206EXTRA_ARGS=( ${LLAMA_CMAKE_EXTRA_ARGS} )1 unmodified linefiecho "[build] cmake args: ${CMAKE_ARGS[*]}"cmake -B build -DCMAKE_BUILD_TYPE=Release "${CMAKE_ARGS[@]}"cmake --build build -j "${CMAKE_BUILD_PARALLEL}" --config Release --target llama-diffusion-cliif [[ ! -x build/bin/llama-diffusion-cli ]]; thenecho "[build] build/bin/llama-diffusion-cli was not produced" >&2exit 1fishopt -s nullglobcp -a build/bin/lib*.so* "${LLAMA_BIN_DIR}/"cp build/bin/llama-diffusion-cli "${LLAMA_DIFFUSION_BIN}"chmod +x "${LLAMA_DIFFUSION_BIN}"echo "[build] Installed ${LLAMA_DIFFUSION_BIN}"
1234567891011124 unmodified lines1718192021221 unmodified line24252627282912 unmodified lines42434445464715 unmodified lines6364656667686970711 unmodified line7374757677787980818283843 unmodified lines88899091929394959697989910010110210310415 unmodified lines1201211221231241251 unmodified line127128129130131132from __future__ import annotationsimport osimport shutilimport statimport subprocessimport tarfileimport tempfileimport zipfilefrom pathlib import Pathfrom urllib.request import urlretrieve4 unmodified lines_runtime_notes: list[str] = []def runtime_status() -> dict[str, object]:1 unmodified line"bin": str(settings.llama_diffusion_bin),"bin_exists": settings.llama_diffusion_bin.exists(),"model_cache_dir": str(settings.model_cache_dir),"notes": list(_runtime_notes[-20:]),}12 unmodified linesdef _download_prebuilt_binary(url: str) -> None:settings.bin_dir.mkdir(parents=True, exist_ok=True)with tempfile.TemporaryDirectory() as td:tempdir = Path(td)archive_path = tempdir / "llama-diffusion-download"15 unmodified linesif not binary or not binary.exists():raise ApiError("runtime_error", "Could not find llama-diffusion-cli in downloaded artifact", 500)shutil.copy2(binary, settings.llama_diffusion_bin)_mark_executable(settings.llama_diffusion_bin)_runtime_notes.append(f"Installed prebuilt binary from {url}")def build_llama_diffusion() -> None:1 unmodified lineif not script.exists():raise ApiError("runtime_error", f"Missing build script: {script}", 500)env = dict(os.environ)env.setdefault("LLAMA_SRC_DIR", str(settings.llama_src_dir))env.setdefault("LLAMA_BIN_DIR", str(settings.bin_dir))env.setdefault("LLAMA_DIFFUSION_BIN", str(settings.llama_diffusion_bin))env.setdefault("LLAMA_BUILD_CUDA", "1" if settings.llama_build_cuda else "0")env.setdefault("LLAMA_CMAKE_EXTRA_ARGS", settings.llama_cmake_extra_args)proc = subprocess.run(["bash", str(script)],3 unmodified linestimeout=int(os.getenv("LLAMA_BUILD_TIMEOUT_SECONDS", "1800")),)if proc.returncode != 0:raise ApiError("runtime_error","Failed to build llama-diffusion-cli. stderr tail: " + proc.stderr[-4000:],500,)_runtime_notes.append("Built llama-diffusion-cli from llama.cpp DiffusionGemma PR")def ensure_runner_binary() -> Path:if settings.llama_diffusion_bin.exists():_mark_executable(settings.llama_diffusion_bin)return settings.llama_diffusion_binif settings.llama_diffusion_bin_url:15 unmodified linesdef ensure_model_file(repo_id: str, filename: str) -> str:settings.model_cache_dir.mkdir(parents=True, exist_ok=True)path = hf_hub_download(repo_id=repo_id,filename=filename,1 unmodified linetoken=os.getenv("HF_TOKEN") or None,)_runtime_notes.append(f"Model ready: {repo_id}/{filename}")return path123456789101112131415164 unmodified lines212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071721 unmodified line7475767778798081828312 unmodified lines9697989910010110215 unmodified lines1181191201211221231241251261271281291301311321331341351361371 unmodified line1391401411421431441451461471481491501511523 unmodified lines15615715815916016116216316416516616716816917017117217317417515 unmodified lines1911921931941951961971 unmodified line199200201202203204205from __future__ import annotationsimport jsonimport osimport shutilimport siteimport statimport subprocessimport tarfileimport tempfileimport zipfilefrom collections import dequefrom datetime import UTC, datetimefrom pathlib import Pathfrom urllib.request import urlretrieve4 unmodified lines_runtime_notes: list[str] = []_events: deque[dict[str, object]] = deque(maxlen=200)def log_event(event: str, **fields: object) -> None:record: dict[str, object] = {"ts": datetime.now(UTC).isoformat(timespec="seconds"),"event": event,**fields,}_events.append(record)print(json.dumps(record, ensure_ascii=False, default=str), flush=True)def runtime_events(limit: int = 100) -> list[dict[str, object]]:limit = max(1, min(limit, 200))return list(_events)[-limit:]def nvidia_library_paths() -> list[str]:paths: list[str] = []seen: set[str] = set()roots = [*site.getsitepackages(), site.getusersitepackages()]for root in roots:if not root:continuebase = Path(root) / "nvidia"if not base.exists():continuefor candidate in base.glob("*/lib"):if candidate.is_dir():value = str(candidate)if value not in seen:seen.add(value)paths.append(value)return pathsdef ld_library_path_for(binary_path: Path | None = None) -> str:paths: list[str] = []if binary_path:paths.append(str(binary_path.resolve().parent))paths.extend(nvidia_library_paths())existing = os.getenv("LD_LIBRARY_PATH", "")if existing:paths.append(existing)return ":".join(paths)def runtime_status() -> dict[str, object]:1 unmodified line"bin": str(settings.llama_diffusion_bin),"bin_exists": settings.llama_diffusion_bin.exists(),"model_cache_dir": str(settings.model_cache_dir),"model_file": str(settings.model_cache_dir / settings.gguf_filename),"model_file_exists": (settings.model_cache_dir / settings.gguf_filename).exists(),"nvidia_library_paths": nvidia_library_paths(),"ld_library_path": ld_library_path_for(settings.llama_diffusion_bin),"notes": list(_runtime_notes[-20:]),}12 unmodified linesdef _download_prebuilt_binary(url: str) -> None:settings.bin_dir.mkdir(parents=True, exist_ok=True)log_event("runner.download.start", url=url)with tempfile.TemporaryDirectory() as td:tempdir = Path(td)archive_path = tempdir / "llama-diffusion-download"15 unmodified linesif not binary or not binary.exists():raise ApiError("runtime_error", "Could not find llama-diffusion-cli in downloaded artifact", 500)# Keep sibling shared libraries with the binary. This mirrors the qwen36# Space strategy: a CUDA runner package is not just the executable.for child in binary.parent.iterdir():target = settings.bin_dir / child.nameif child.is_file() or child.is_symlink():shutil.copy2(child, target)elif child.is_dir() and child.name in {"lib", "lib64"}:if target.exists():shutil.rmtree(target)shutil.copytree(child, target, symlinks=True)_mark_executable(settings.llama_diffusion_bin)_runtime_notes.append(f"Installed prebuilt binary from {url}")log_event("runner.download.finish", bin=str(settings.llama_diffusion_bin))def build_llama_diffusion() -> None:1 unmodified lineif not script.exists():raise ApiError("runtime_error", f"Missing build script: {script}", 500)log_event("runner.build.start", script=str(script))env = dict(os.environ)env.setdefault("LLAMA_SRC_DIR", str(settings.llama_src_dir))env.setdefault("LLAMA_BIN_DIR", str(settings.bin_dir))env.setdefault("LLAMA_DIFFUSION_BIN", str(settings.llama_diffusion_bin))env.setdefault("LLAMA_BUILD_CUDA", "1" if settings.llama_build_cuda else "0")env.setdefault("LLAMA_CMAKE_EXTRA_ARGS", settings.llama_cmake_extra_args)env["LD_LIBRARY_PATH"] = ld_library_path_for(settings.llama_diffusion_bin)proc = subprocess.run(["bash", str(script)],3 unmodified linestimeout=int(os.getenv("LLAMA_BUILD_TIMEOUT_SECONDS", "1800")),)if proc.returncode != 0:log_event("runner.build.failed", stderr_tail=proc.stderr[-1200:])raise ApiError("runtime_error","Failed to build llama-diffusion-cli. stderr tail: " + proc.stderr[-4000:],500,)_runtime_notes.append("Built llama-diffusion-cli from llama.cpp DiffusionGemma PR")log_event("runner.build.finish", bin=str(settings.llama_diffusion_bin))def ensure_runner_binary() -> Path:if settings.llama_diffusion_bin.exists():_mark_executable(settings.llama_diffusion_bin)log_event("runner.cache_hit", bin=str(settings.llama_diffusion_bin))return settings.llama_diffusion_binif settings.llama_diffusion_bin_url:15 unmodified linesdef ensure_model_file(repo_id: str, filename: str) -> str:settings.model_cache_dir.mkdir(parents=True, exist_ok=True)log_event("model.download.start", repo_id=repo_id, filename=filename)path = hf_hub_download(repo_id=repo_id,filename=filename,1 unmodified linetoken=os.getenv("HF_TOKEN") or None,)_runtime_notes.append(f"Model ready: {repo_id}/{filename}")log_event("model.download.finish", path=str(path))return path
1 unmodified line2345678910111239 unmodified lines5253545556575859606162631 unmodified lineimport reimport shleximport subprocessfrom typing import Anyfrom src.config import settingsfrom src.errors import ApiError_LOG_LINE_PATTERNS = [re.compile(r"^llama_.*", re.IGNORECASE),39 unmodified linesdef _run_once(cmd: list[str], prompt: str | None) -> subprocess.CompletedProcess[str]:return subprocess.run(cmd,input=prompt,text=True,capture_output=True,timeout=settings.cli_timeout_seconds,)1 unmodified line23456789101112131439 unmodified lines5455565758596061626364656667681 unmodified lineimport reimport shleximport osimport subprocessfrom typing import Anyfrom src.config import settingsfrom src.errors import ApiErrorfrom src.prepare import ld_library_path_for_LOG_LINE_PATTERNS = [re.compile(r"^llama_.*", re.IGNORECASE),39 unmodified linesdef _run_once(cmd: list[str], prompt: str | None) -> subprocess.CompletedProcess[str]:env = dict(os.environ)env["LD_LIBRARY_PATH"] = ld_library_path_for(settings.llama_diffusion_bin)return subprocess.run(cmd,input=prompt,text=True,capture_output=True,timeout=settings.cli_timeout_seconds,env=env,)
DEPLOY.md+17-1
README.md+29-3
app.py+108-1
scripts/build_llama_diffusion.sh+43-2
src/prepare.py+74-1
src/runner.py+5