Unverified Commit fed5849d authored by Isotr0py's avatar Isotr0py Committed by GitHub
Browse files

[Bugfix] Fix failing GGUF models test (#22174)


Signed-off-by: default avatarIsotr0py <mozf@mail2.sysu.edu.cn>
parent c1b4eb04
...@@ -293,17 +293,26 @@ def maybe_override_with_speculators_target_model( ...@@ -293,17 +293,26 @@ def maybe_override_with_speculators_target_model(
model: str, model: str,
tokenizer: str, tokenizer: str,
trust_remote_code: bool, trust_remote_code: bool,
revision: Optional[str] = None) -> tuple[str, str]: revision: Optional[str] = None,
**kwargs,
) -> tuple[str, str]:
""" """
If running a speculators config, override running model with target model If running a speculators config, override running model with target model
""" """
is_gguf = check_gguf_file(model)
if is_gguf:
kwargs["gguf_file"] = Path(model).name
gguf_model_repo = Path(model).parent
else:
gguf_model_repo = None
config_dict, _ = PretrainedConfig.get_config_dict( config_dict, _ = PretrainedConfig.get_config_dict(
model, model if gguf_model_repo is None else gguf_model_repo,
revision=revision, revision=revision,
trust_remote_code=trust_remote_code, trust_remote_code=trust_remote_code,
token=_get_hf_token(), token=_get_hf_token(),
**kwargs,
) )
spec_config = config_dict.get("speculators_config") spec_config = config_dict.get("speculators_config", None)
# Return the target model # Return the target model
if spec_config is not None: if spec_config is not None:
model = tokenizer = spec_config["verifier"]["name_or_path"] model = tokenizer = spec_config["verifier"]["name_or_path"]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment