Skip to content

Commit

Permalink
fix citest (#2953)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jintao-Huang authored Jan 21, 2025
1 parent 3f83691 commit c34b128
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions swift/llm/model/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,11 @@ def get_model_tokenizer_from_local(model_dir: str,
model = automodel_class.from_pretrained(
model_dir, config=model_config, torch_dtype=torch_dtype, trust_remote_code=True, **model_kwargs)

# fix not save modeling_xxx.py (transformers 4.45)
# https://github.com/huggingface/transformers/issues/24737
has_remote_code = hasattr(model_config, 'auto_map') and automodel_class.__name__ in model_config.auto_map
if model is not None and has_remote_code and model._auto_class is None:
model._auto_class = automodel_class.__name__
# fix not save modeling_xxx.py (transformers 4.45)
# https://github.com/huggingface/transformers/issues/24737
has_remote_code = hasattr(model_config, 'auto_map') and automodel_class.__name__ in model_config.auto_map
if has_remote_code and model._auto_class is None:
model._auto_class = automodel_class.__name__
return model, tokenizer


Expand Down

0 comments on commit c34b128

Please sign in to comment.