Commit 34e8cfc7 authored by Kapsner's avatar Kapsner
Browse files

refactor: enhancing detection of yaml files

parent 87bbe588
......@@ -39,11 +39,15 @@ def load_dataset_info(task_dir: Pathlike) -> dict:
"""
task_dir = Path(task_dir)
yaml_path = task_dir / "dataset.yaml"
yaml_path_fallback = task_dir / "dataset.yml"
json_path = task_dir / "dataset.json"
if yaml_path.is_file():
with open(yaml_path, 'r') as f:
data = yaml.full_load(f)
elif yaml_path_fallback.is_file():
with open(yaml_path_fallback, 'r') as f:
data = yaml.full_load(f)
elif json_path.is_file():
with open(json_path, "r") as f:
data = json.load(f)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment