Skip to content

Commit

Permalink
Fix from_config (huggingface#23246)
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
Kunhao ZHENG authored and gojiteji committed Jun 5, 2023
1 parent 01a81b9 commit c6fc02c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/transformers/models/auto/auto_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,7 @@ def from_config(cls, config, **kwargs):
repo_id, class_ref = class_ref.split("--")
else:
repo_id = config.name_or_path
module_file, class_name = class_ref.split(".")
model_class = get_class_from_dynamic_module(repo_id, module_file + ".py", class_name, **kwargs)
model_class = get_class_from_dynamic_module(class_ref, repo_id, **kwargs)
return model_class._from_config(config, **kwargs)
elif type(config) in cls._model_mapping.keys():
model_class = _get_model_class(config, cls._model_mapping)
Expand Down

0 comments on commit c6fc02c

Please sign in to comment.