From ae4e96a2bcdcbdf7ebc09dd79bc1e5d6ac381319 Mon Sep 17 00:00:00 2001 From: Yan Ru Pei Date: Wed, 15 Oct 2025 19:48:40 -0700 Subject: [PATCH] fix: mocker engines should ignore downloading weights from hf (again) (#3664) Signed-off-by: PeaBrane --- launch/dynamo-run/src/lib.rs | 4 +++- lib/bindings/python/rust/llm/entrypoint.rs | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/launch/dynamo-run/src/lib.rs b/launch/dynamo-run/src/lib.rs index c090898c4..045dbd298 100644 --- a/launch/dynamo-run/src/lib.rs +++ b/launch/dynamo-run/src/lib.rs @@ -37,7 +37,9 @@ pub async fn run( } Some(p) => { // model_path might be an HF repo, not a local path. Resolve it by downloading. - Some(LocalModel::fetch(&p.display().to_string(), false).await?) + // Mocker only needs tokenizer, not weights + let ignore_weights = matches!(out_opt, Some(Output::Mocker)); + Some(LocalModel::fetch(&p.display().to_string(), ignore_weights).await?) } }; diff --git a/lib/bindings/python/rust/llm/entrypoint.rs b/lib/bindings/python/rust/llm/entrypoint.rs index bc262fdd9..555a2ab8f 100644 --- a/lib/bindings/python/rust/llm/entrypoint.rs +++ b/lib/bindings/python/rust/llm/entrypoint.rs @@ -215,7 +215,9 @@ pub fn make_engine<'p>( let local_path = if model_path.exists() { model_path } else { - LocalModel::fetch(&model_path.display().to_string(), false) + // Mocker only needs tokenizer, not weights + let ignore_weights = matches!(args.engine_type, EngineType::Mocker); + LocalModel::fetch(&model_path.display().to_string(), ignore_weights) .await .map_err(to_pyerr)? };