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
renzhc
diffusers_dcu
Commits
4497e78d
"tests/vscode:/vscode.git/clone" did not exist on "72b3e078af32b9b237d024526f8f25fffe088c03"
Commit
4497e78d
authored
Jun 20, 2022
by
Nathan Lambert
Browse files
merge unet-rl formatting
parents
49718b47
77aadfee
Changes
41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
utils/check_table.py
utils/check_table.py
+8
-8
No files found.
utils/check_table.py
View file @
4497e78d
...
...
@@ -22,7 +22,7 @@ import re
# All paths are set with the intent you should run this script from the root of the repo with the command
# python utils/check_table.py
TRANSFORMERS_PATH
=
"src/
transform
ers"
TRANSFORMERS_PATH
=
"src/
diffus
ers"
PATH_TO_DOCS
=
"docs/source/en"
REPO_PATH
=
"."
...
...
@@ -62,13 +62,13 @@ _re_flax_models = re.compile(r"Flax(.*)(?:Model|Encoder|Decoder|ForConditionalGe
_re_pt_models
=
re
.
compile
(
r
"(.*)(?:Model|Encoder|Decoder|ForConditionalGeneration)"
)
# This is to make sure the
transform
ers module imported is the one in the repo.
# This is to make sure the
diffus
ers module imported is the one in the repo.
spec
=
importlib
.
util
.
spec_from_file_location
(
"
transform
ers"
,
"
diffus
ers"
,
os
.
path
.
join
(
TRANSFORMERS_PATH
,
"__init__.py"
),
submodule_search_locations
=
[
TRANSFORMERS_PATH
],
)
transform
ers_module
=
spec
.
loader
.
load_module
()
diffus
ers_module
=
spec
.
loader
.
load_module
()
# Thanks to https://stackoverflow.com/questions/29916065/how-to-do-camelcase-split-in-python
...
...
@@ -88,10 +88,10 @@ def _center_text(text, width):
def
get_model_table_from_auto_modules
():
"""Generates an up-to-date model table from the content of the auto modules."""
# Dictionary model names to config.
config_maping_names
=
transform
ers_module
.
models
.
auto
.
configuration_auto
.
CONFIG_MAPPING_NAMES
config_maping_names
=
diffus
ers_module
.
models
.
auto
.
configuration_auto
.
CONFIG_MAPPING_NAMES
model_name_to_config
=
{
name
:
config_maping_names
[
code
]
for
code
,
name
in
transform
ers_module
.
MODEL_NAMES_MAPPING
.
items
()
for
code
,
name
in
diffus
ers_module
.
MODEL_NAMES_MAPPING
.
items
()
if
code
in
config_maping_names
}
model_name_to_prefix
=
{
name
:
config
.
replace
(
"ConfigMixin"
,
""
)
for
name
,
config
in
model_name_to_config
.
items
()}
...
...
@@ -103,8 +103,8 @@ def get_model_table_from_auto_modules():
tf_models
=
collections
.
defaultdict
(
bool
)
flax_models
=
collections
.
defaultdict
(
bool
)
# Let's lookup through all
transform
ers object (once).
for
attr_name
in
dir
(
transform
ers_module
):
# Let's lookup through all
diffus
ers object (once).
for
attr_name
in
dir
(
diffus
ers_module
):
lookup_dict
=
None
if
attr_name
.
endswith
(
"Tokenizer"
):
lookup_dict
=
slow_tokenizers
...
...
Prev
1
2
3
Next
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