Spaces:
Running
Running
File size: 649 Bytes
03b0173 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | """Task registry. To register a new task:
1. Create a subpackage under src/tasks/<your_task>/ exposing TASK (see _template/).
2. Import it below and add to TASKS.
"""
from typing import Dict
from src.tasks.base import TaskPlugin
from src.tasks.task_future_prediction import TASK as TASK_FUTURE_PRED
from src.tasks.task_property_estimation import TASK as TASK_PROPERTY_EST
TASKS: Dict[str, TaskPlugin] = {
TASK_FUTURE_PRED.name: TASK_FUTURE_PRED,
TASK_PROPERTY_EST.name: TASK_PROPERTY_EST,
}
def get_task(name: str) -> TaskPlugin:
if name not in TASKS:
raise ValueError(f"Unknown task: {name}")
return TASKS[name]
|