Spaces:
Sleeping
Sleeping
Upload scripts/utils.py with huggingface_hub
Browse files- scripts/utils.py +15 -0
scripts/utils.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import yaml
|
| 2 |
+
import os
|
| 3 |
+
|
| 4 |
+
def load_config(config_name="config.yaml"):
|
| 5 |
+
"""
|
| 6 |
+
Load configuration from a YAML file.
|
| 7 |
+
Args:
|
| 8 |
+
config_path: Path to the YAML configuration file.
|
| 9 |
+
Returns:
|
| 10 |
+
Dictionary with the configuration data.
|
| 11 |
+
"""
|
| 12 |
+
from config.data_paths import ROOT_DIR
|
| 13 |
+
with open(os.path.join(ROOT_DIR, 'config', config_name), "r") as file:
|
| 14 |
+
config = yaml.safe_load(file)
|
| 15 |
+
return config
|