Skip to content

The agent that grows with you

refactor(hermes_cli/web_routers): local_models — keep explicit pump read loop

Teknium5ad58e8254f2
diff --git a/hermes_cli/web_routers/local_models.py b/hermes_cli/web_routers/local_models.py
index 7c77fecfa81..cb771e482a8 100644
--- a/hermes_cli/web_routers/local_models.py
+++ b/hermes_cli/web_routers/local_models.py
@@ -199,7 +199,10 @@ def download_file(url: str, dest: Path, job: Dict[str, Any], *,
progress_lock = threading.Lock()
def pump(r, f) -> None:
- for chunk in iter(lambda: r.read(_CHUNK), b""):
+ while True:
+ chunk = r.read(_CHUNK)
+ if not chunk:
+ break
f.write(chunk)
with progress_lock:
file_done[0] += len(chunk)