lolcats / src /trainer /__init__.py
ariG23498's picture
ariG23498 HF staff
chore: adding lolcats configs scrc and src
ae81e0f
raw
history blame contribute delete
414 Bytes
import importlib
from .optim import get_optimizer, get_scheduler
def get_trainer(name: str):
"""
Return our trainer class
"""
try:
module = importlib.import_module(f'src.trainer.{name}')
except ModuleNotFoundError as e:
print(e)
print('-> Using default trainer')
module = importlib.import_module('src.trainer.default')
return getattr(module, 'OurTrainer')