Skip to content

Commit fed5849

Browse files
authored
[Bugfix] Fix failing GGUF models test (#22174)
Signed-off-by: Isotr0py <mozf@mail2.sysu.edu.cn>
1 parent c1b4eb0 commit fed5849

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

vllm/transformers_utils/config.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -290,20 +290,29 @@ def _maybe_remap_hf_config_attrs(config: PretrainedConfig) -> PretrainedConfig:
290290

291291

292292
def maybe_override_with_speculators_target_model(
293-
model: str,
294-
tokenizer: str,
295-
trust_remote_code: bool,
296-
revision: Optional[str] = None) -> tuple[str, str]:
293+
model: str,
294+
tokenizer: str,
295+
trust_remote_code: bool,
296+
revision: Optional[str] = None,
297+
**kwargs,
298+
) -> tuple[str, str]:
297299
"""
298300
If running a speculators config, override running model with target model
299301
"""
302+
is_gguf = check_gguf_file(model)
303+
if is_gguf:
304+
kwargs["gguf_file"] = Path(model).name
305+
gguf_model_repo = Path(model).parent
306+
else:
307+
gguf_model_repo = None
300308
config_dict, _ = PretrainedConfig.get_config_dict(
301-
model,
309+
model if gguf_model_repo is None else gguf_model_repo,
302310
revision=revision,
303311
trust_remote_code=trust_remote_code,
304312
token=_get_hf_token(),
313+
**kwargs,
305314
)
306-
spec_config = config_dict.get("speculators_config")
315+
spec_config = config_dict.get("speculators_config", None)
307316
# Return the target model
308317
if spec_config is not None:
309318
model = tokenizer = spec_config["verifier"]["name_or_path"]

0 commit comments

Comments
 (0)