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
f4f4e6b2
"tests/git@developer.sourcefind.cn:wangsen/paddle_dbnet.git" did not exist on "e5dc3611cd415a2df7d0dd3e3281a44906af6c4b"
Unverified
Commit
f4f4e6b2
authored
Aug 30, 2021
by
Sylvain Gugger
Committed by
GitHub
Aug 30, 2021
Browse files
Use existing functionality for #13251 (#13333)
parent
d5064953
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/transformers/models/auto/tokenization_auto.py
src/transformers/models/auto/tokenization_auto.py
+3
-3
No files found.
src/transformers/models/auto/tokenization_auto.py
View file @
f4f4e6b2
...
@@ -37,6 +37,7 @@ from .configuration_auto import (
...
@@ -37,6 +37,7 @@ from .configuration_auto import (
CONFIG_MAPPING_NAMES
,
CONFIG_MAPPING_NAMES
,
AutoConfig
,
AutoConfig
,
config_class_to_model_type
,
config_class_to_model_type
,
model_type_to_module_name
,
replace_list_option_in_docstrings
,
replace_list_option_in_docstrings
,
)
)
...
@@ -230,10 +231,9 @@ def tokenizer_class_from_name(class_name: str):
...
@@ -230,10 +231,9 @@ def tokenizer_class_from_name(class_name: str):
if
class_name
in
tokenizers
:
if
class_name
in
tokenizers
:
break
break
if
module_name
==
"openai-gpt"
:
module_name
=
model_type_to_module_name
(
module_name
)
module_name
=
"openai"
module
=
importlib
.
import_module
(
f
".
{
module_name
.
replace
(
'-'
,
'_'
)
}
"
,
"transformers.models"
)
module
=
importlib
.
import_module
(
f
".
{
module_name
}
"
,
"transformers.models"
)
return
getattr
(
module
,
class_name
)
return
getattr
(
module
,
class_name
)
...
...
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