Răsfoiți Sursa

fix(docker): rewrite resolved HF cache path to container mount target

resolve_path_ref_on_node returned a host-side path (e.g.
/home/<user>/.cache/huggingface/hub/.../snapshots/<hash>/<sub>), but it is
substituted into recipe args/env (e.g. --speculative-config JSON) consumed
*inside* the container, where the HF cache is bind-mounted at
/root/.cache/huggingface — the host prefix does not exist there, so the
substituted path resolved to nothing.

Rewrite the host cache-dir prefix to the container mount target
(/root/.cache/huggingface) so the path resolves correctly inside the
container. This is a no-op when the host cache dir already equals the
container target (root user, unset hf_cache_dir).
Alexander Korolev 3 luni în urmă
părinte
comite
dcb28faf1e
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      src/docker/mod.rs

+ 1 - 1
src/docker/mod.rs

@@ -403,7 +403,7 @@ async fn resolve_path_ref_on_node(
         );
         anyhow::bail!(hint);
     }
-    Ok(resolved_path)
+    Ok(resolved_path.replace(&hf_cache.display().to_string(), "/root/.cache/huggingface"))
 }
 
 #[cfg(test)]