Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
366a8ca0
Unverified
Commit
366a8ca0
authored
May 09, 2023
by
Kunhao ZHENG
Committed by
GitHub
May 09, 2023
Browse files
Fix `from_config` (#23246)
fix
parent
69ee4624
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
src/transformers/models/auto/auto_factory.py
src/transformers/models/auto/auto_factory.py
+1
-2
No files found.
src/transformers/models/auto/auto_factory.py
View file @
366a8ca0
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment