Spaces:
Runtime error
Runtime error
File size: 586 Bytes
bcb83c0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
import logging
import pprint
import yaml
def parse_configs(configs_path: str) -> dict:
"""Parse configs from the YAML file.
Args:
configs_path (str): Path to the YAML file
Returns:
dict: Parsed configs
"""
configs = yaml.safe_load(open(configs_path, "r"))
logger.info(f"Configs: {pprint.pformat(configs)}")
return configs
CONFIGS_PATH = "configs.yaml"
MAX_TRIES = 6
CATEGORIES = ["Country", "Animal", "Food", "Movie"]
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__file__)
configs = parse_configs(CONFIGS_PATH)
|