Spaces:
Running
on
Zero
Running
on
Zero
Commit
Β·
1688157
1
Parent(s):
74adfb5
Summary
Browse files- app/config.py +5 -5
- requirements.txt +2 -1
app/config.py
CHANGED
|
@@ -5,7 +5,7 @@ Description: Configuration module for handling settings.
|
|
| 5 |
License: MIT License
|
| 6 |
"""
|
| 7 |
|
| 8 |
-
import
|
| 9 |
from pathlib import Path
|
| 10 |
from collections.abc import Callable
|
| 11 |
from types import SimpleNamespace
|
|
@@ -29,8 +29,8 @@ def flatten_dict(prefix: str, d: dict) -> dict:
|
|
| 29 |
def load_tab_creators(
|
| 30 |
file_path: str, available_functions: dict[str, Callable]
|
| 31 |
) -> dict[str, Callable]:
|
| 32 |
-
with open(file_path, "
|
| 33 |
-
config =
|
| 34 |
|
| 35 |
tab_creators_data = config.get("TabCreators", {})
|
| 36 |
|
|
@@ -38,8 +38,8 @@ def load_tab_creators(
|
|
| 38 |
|
| 39 |
|
| 40 |
def load_config(file_path: str) -> SimpleNamespace:
|
| 41 |
-
with open(file_path, "
|
| 42 |
-
config =
|
| 43 |
|
| 44 |
config_data = flatten_dict("", config)
|
| 45 |
|
|
|
|
| 5 |
License: MIT License
|
| 6 |
"""
|
| 7 |
|
| 8 |
+
import toml
|
| 9 |
from pathlib import Path
|
| 10 |
from collections.abc import Callable
|
| 11 |
from types import SimpleNamespace
|
|
|
|
| 29 |
def load_tab_creators(
|
| 30 |
file_path: str, available_functions: dict[str, Callable]
|
| 31 |
) -> dict[str, Callable]:
|
| 32 |
+
with open(file_path, "r") as f:
|
| 33 |
+
config = toml.load(f)
|
| 34 |
|
| 35 |
tab_creators_data = config.get("TabCreators", {})
|
| 36 |
|
|
|
|
| 38 |
|
| 39 |
|
| 40 |
def load_config(file_path: str) -> SimpleNamespace:
|
| 41 |
+
with open(file_path, "r") as f:
|
| 42 |
+
config = toml.load(f)
|
| 43 |
|
| 44 |
config_data = flatten_dict("", config)
|
| 45 |
|
requirements.txt
CHANGED
|
@@ -10,4 +10,5 @@ transformers==4.46.1
|
|
| 10 |
pillow==11.0.0
|
| 11 |
pandas==2.2.3
|
| 12 |
numpy==1.26.4
|
| 13 |
-
matplotlib==3.9.2
|
|
|
|
|
|
| 10 |
pillow==11.0.0
|
| 11 |
pandas==2.2.3
|
| 12 |
numpy==1.26.4
|
| 13 |
+
matplotlib==3.9.2
|
| 14 |
+
toml==0.10.2
|