OCEANAI / app /practical_tasks.py
ElenaRyumina's picture
v0.3.0 (#3)
d0f716d verified
raw
history blame
720 Bytes
"""
File: practical_tasks.py
Author: Dmitry Ryumin
Description: Utility functions for working with practical tasks data.
License: MIT License
"""
import yaml
from typing import Dict, List
# Importing necessary components for the Gradio app
def load_practical_tasks_data(file_path: str) -> List:
with open(file_path, "r") as file:
return yaml.safe_load(file) or []
def transform_practical_tasks_data(data: List) -> Dict:
output_dict = {item["task"]: item["subtasks"] for item in data}
return output_dict
yaml_file_path = "./practical_tasks.yaml"
practical_tasks_data = load_practical_tasks_data(yaml_file_path)
supported_practical_tasks = transform_practical_tasks_data(practical_tasks_data)