pretrained-models.pytorch icon indicating copy to clipboard operation
pretrained-models.pytorch copied to clipboard

Update __init__.py

Open rawmarshmellows opened this issue 6 years ago • 1 comments

Best practices to import with "*", also fixes my use case of automatically generate lookup dictionary by having the names of the models being exported:

from pretrainedmodels.models import __all__ as pretrained_models_names

pretrained_models_lookup = {
    name: getattr(importlib.import_module("pretrainedmodels.models"), name)
    for name in pretrained_models_names
}

lookup = {**pretrained_models_lookup}

rawmarshmellows avatar Aug 04 '19 23:08 rawmarshmellows

Thanks! I'll look into it asap

Cadene avatar Aug 05 '19 16:08 Cadene