config.py 480 B

123456789101112131415
  1. # Copyright (c) Meta Platforms, Inc. and affiliates.
  2. # This software may be used and distributed according to the terms of the Llama 2 Community License Agreement.
  3. import yaml
  4. import os
  5. def load_config():
  6. # Read the YAML configuration file
  7. file_path = "./config.yaml"
  8. with open(file_path, "r") as file:
  9. config = yaml.safe_load(file)
  10. # Set the API key from the environment variable
  11. config["api_key"] = os.environ["OCTOAI_API_TOKEN"]
  12. return config