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
640e1b6c
"tests/vscode:/vscode.git/clone" did not exist on "35e9d2b223067d8e5da8aa96d254747d6f9ab352"
Unverified
Commit
640e1b6c
authored
Jul 21, 2023
by
Sylvain Gugger
Committed by
GitHub
Jul 21, 2023
Browse files
Remove tokenizers from the doc table (#24963)
parent
0511369a
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
202 additions
and
212 deletions
+202
-212
docs/source/en/index.md
docs/source/en/index.md
+200
-200
utils/check_table.py
utils/check_table.py
+2
-12
No files found.
docs/source/en/index.md
View file @
640e1b6c
This diff is collapsed.
Click to expand it.
utils/check_table.py
View file @
640e1b6c
...
...
@@ -93,8 +93,6 @@ def get_model_table_from_auto_modules():
model_name_to_prefix
=
{
name
:
config
.
replace
(
"Config"
,
""
)
for
name
,
config
in
model_name_to_config
.
items
()}
# Dictionaries flagging if each model prefix has a slow/fast tokenizer, backend in PT/TF/Flax.
slow_tokenizers
=
collections
.
defaultdict
(
bool
)
fast_tokenizers
=
collections
.
defaultdict
(
bool
)
pt_models
=
collections
.
defaultdict
(
bool
)
tf_models
=
collections
.
defaultdict
(
bool
)
flax_models
=
collections
.
defaultdict
(
bool
)
...
...
@@ -102,13 +100,7 @@ def get_model_table_from_auto_modules():
# Let's lookup through all transformers object (once).
for
attr_name
in
dir
(
transformers_module
):
lookup_dict
=
None
if
attr_name
.
endswith
(
"Tokenizer"
):
lookup_dict
=
slow_tokenizers
attr_name
=
attr_name
[:
-
9
]
elif
attr_name
.
endswith
(
"TokenizerFast"
):
lookup_dict
=
fast_tokenizers
attr_name
=
attr_name
[:
-
13
]
elif
_re_tf_models
.
match
(
attr_name
)
is
not
None
:
if
_re_tf_models
.
match
(
attr_name
)
is
not
None
:
lookup_dict
=
tf_models
attr_name
=
_re_tf_models
.
match
(
attr_name
).
groups
()[
0
]
elif
_re_flax_models
.
match
(
attr_name
)
is
not
None
:
...
...
@@ -129,7 +121,7 @@ def get_model_table_from_auto_modules():
# Let's build that table!
model_names
=
list
(
model_name_to_config
.
keys
())
model_names
.
sort
(
key
=
str
.
lower
)
columns
=
[
"Model"
,
"Tokenizer slow"
,
"Tokenizer fast"
,
"PyTorch support"
,
"TensorFlow support"
,
"Flax Support"
]
columns
=
[
"Model"
,
"PyTorch support"
,
"TensorFlow support"
,
"Flax Support"
]
# We'll need widths to properly display everything in the center (+2 is to leave one extra space on each side).
widths
=
[
len
(
c
)
+
2
for
c
in
columns
]
widths
[
0
]
=
max
([
len
(
name
)
for
name
in
model_names
])
+
2
...
...
@@ -144,8 +136,6 @@ def get_model_table_from_auto_modules():
prefix
=
model_name_to_prefix
[
name
]
line
=
[
name
,
check
[
slow_tokenizers
[
prefix
]],
check
[
fast_tokenizers
[
prefix
]],
check
[
pt_models
[
prefix
]],
check
[
tf_models
[
prefix
]],
check
[
flax_models
[
prefix
]],
...
...
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