[docs]defsupported_tasks()->List[str]:"Returns the list of supported tasks."returnsorted(mod.__TASK__formodin__TASKS__)
[docs]defreduce_model_config(config:Any,task:str)->Dict[str,Any]:"""Reduces a model size."""tasks={mod.__TASK__:mod.reduce_model_configformodin__TASKS__}asserttaskintasks,f"Task {task!r} not found in {sorted(tasks)}"returntasks[task](config)
[docs]defrandom_input_kwargs(config:Any,task:str)->Tuple[Dict[str,Any],Callable]:""" Inputs kwargs. If the configuration is None, the function selects typical dimensions. It returns parameters and a function. The function creates dummy inputs if it receives the parameters returned as a first result. """tasks={mod.__TASK__:mod.random_input_kwargsformodin__TASKS__}asserttaskintasks,f"Task {task!r} not found in {sorted(tasks)}"returntasks[task](config)