File size: 584 Bytes
62f828b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import yaml

def load_config(config_path="configs/config.yaml"):
    """

    Load the configuration from a YAML file.



    Args:

        config_path: Path to the configuration file.



    Returns:

        dict: Configuration dictionary.

    """
    try:
        with open(config_path, "r") as file:
            config = yaml.safe_load(file)
        return config
    except FileNotFoundError:
        raise Exception(f"Configuration file '{config_path}' not found.")
    except yaml.YAMLError as e:
        raise Exception(f"Error parsing configuration file: {e}")