MCPcopy Create free account
hub / github.com/YesianRohn/TextSSR / check_model_list

Function check_model_list

diffusers/utils/check_repo.py:209–226  ·  view source on GitHub ↗

Check the model list inside the transformers library.

()

Source from the content-addressed store, hash-verified

207
208
209def check_model_list():
210 """Check the model list inside the transformers library."""
211 # Get the models from the directory structure of `src/diffusers/models/`
212 models_dir = os.path.join(PATH_TO_DIFFUSERS, "models")
213 _models = []
214 for model in os.listdir(models_dir):
215 model_dir = os.path.join(models_dir, model)
216 if os.path.isdir(model_dir) and "__init__.py" in os.listdir(model_dir):
217 _models.append(model)
218
219 # Get the models from the directory structure of `src/transformers/models/`
220 models = [model for model in dir(diffusers.models) if not model.startswith("__")]
221
222 missing_models = sorted(set(_models).difference(models))
223 if missing_models:
224 raise Exception(
225 f"The following models should be included in {models_dir}/__init__.py: {','.join(missing_models)}."
226 )
227
228
229# If some modeling modules should be ignored for all checks, they should be added in the nested list

Callers 1

check_repo_qualityFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected