|
|
|
|
|
|
name: importlib.import_module(name) |
|
|
|
for finder, name, ispkg in pkgutil.iter_modules(paths) |
|
|
|
} |
|
|
|
logger.info(f"The following plugins are available {discovered_plugins}") |
|
|
|
if discovered_plugins: |
|
|
|
logger.info(f"The following plugins are available {discovered_plugins}") |
|
|
|
if len(new_initializers) <= 0: |
|
|
|
return |
|
|
|
if len(new_initializers) == 0: |
|
|
|
return [] |
|
|
|
elif len(new_initializers) == 1: |
|
|
|
# load the initializer |
|
|
|
logger.info("Registering new initializer") |
|
|
|
|
|
|
return new_trainers |
|
|
|
else: |
|
|
|
raise ValueError( |
|
|
|
"there should be exactly one initializer passed through plugins option" |
|
|
|
"There should be exactly one initializer passed through plugins option." |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|