Unverified Commit c89bdfbe authored by Sylvain Gugger's avatar Sylvain Gugger Committed by GitHub
Browse files

Reorganize repo (#8580)

* Put models in subfolders

* Styling

* Fix imports in tests

* More fixes in test imports

* Sneaky hidden imports

* Fix imports in doc files

* More sneaky imports

* Finish fixing tests

* Fix examples

* Fix path for copies

* More fixes for examples

* Fix dummy files

* More fixes for example

* More model import fixes

* Is this why you're unhappy GitHub?

* Fix imports in conver command
parent 90150733
...@@ -308,12 +308,12 @@ def check_all_models_are_documented(): ...@@ -308,12 +308,12 @@ def check_all_models_are_documented():
def get_all_auto_configured_models(): def get_all_auto_configured_models():
""" Return the list of all models in at least one auto class.""" """ Return the list of all models in at least one auto class."""
result = set() # To avoid duplicates we concatenate all model classes in a set. result = set() # To avoid duplicates we concatenate all model classes in a set.
for attr_name in dir(transformers.modeling_auto): for attr_name in dir(transformers.models.auto.modeling_auto):
if attr_name.startswith("MODEL_") and attr_name.endswith("MAPPING"): if attr_name.startswith("MODEL_") and attr_name.endswith("MAPPING"):
result = result | set(getattr(transformers.modeling_auto, attr_name).values()) result = result | set(getattr(transformers.models.auto.modeling_auto, attr_name).values())
for attr_name in dir(transformers.modeling_tf_auto): for attr_name in dir(transformers.models.auto.modeling_tf_auto):
if attr_name.startswith("TF_MODEL_") and attr_name.endswith("MAPPING"): if attr_name.startswith("TF_MODEL_") and attr_name.endswith("MAPPING"):
result = result | set(getattr(transformers.modeling_tf_auto, attr_name).values()) result = result | set(getattr(transformers.models.auto.modeling_tf_auto, attr_name).values())
return [cls.__name__ for cls in result] return [cls.__name__ for cls in result]
......
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