Unverified Commit 366a8ca0 authored by Kunhao ZHENG's avatar Kunhao ZHENG Committed by GitHub
Browse files

Fix `from_config` (#23246)

fix
parent 69ee4624
......@@ -407,8 +407,7 @@ class _BaseAutoModelClass:
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)
......
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