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

Function check_models_are_in_init

diffusers/utils/check_repo.py:298–310  ·  view source on GitHub ↗

Checks all models defined in the library are in the main init.

()

Source from the content-addressed store, hash-verified

296
297
298def check_models_are_in_init():
299 """Checks all models defined in the library are in the main init."""
300 models_not_in_init = []
301 dir_transformers = dir(diffusers)
302 for module in get_model_modules():
303 models_not_in_init += [
304 model[0] for model in get_models(module, include_pretrained=True) if model[0] not in dir_transformers
305 ]
306
307 # Remove private models
308 models_not_in_init = [model for model in models_not_in_init if not is_a_private_model(model)]
309 if len(models_not_in_init) > 0:
310 raise Exception(f"The following models should be in the main init: {','.join(models_not_in_init)}.")
311
312
313# If some test_modeling files should be ignored when checking models are all tested, they should be added in the

Callers 1

check_repo_qualityFunction · 0.85

Calls 3

get_model_modulesFunction · 0.85
get_modelsFunction · 0.85
is_a_private_modelFunction · 0.85

Tested by

no test coverage detected