It could be nice to have these args be able to be validated against a function target:
arg_names = inspect.getfullargspec(pretrain_fn).args
missing = set(arg_names) - set(arg_dict.keys())
extra = set(arg_dict.keys()) - set(arg_names)
if missing:
raise RuntimeError(f"Missing arguments: {missing}")
if extra:
logger.warning(f"Extra arguments that would be ignored: {extra}")
for key in extra:
del arg_dict[key]
It could be nice to have these args be able to be validated against a function target: