Groq-GPT / groq_app.py
LichtLiu's picture
update 20241006
5605340
raw
history blame contribute delete
630 Bytes
import argparse
import yaml
import os
parser = argparse.ArgumentParser()
parser.add_argument("--config", type=str, default="config.yaml.dev")
parser.add_argument("--mode", type=str, default="cli")
args = parser.parse_args()
if __name__ != "__main__":
args.config = "config.yaml"
os.makedirs("public/images", exist_ok=True)
os.makedirs("public/audios", exist_ok=True)
os.makedirs("public/videos", exist_ok=True)
config = yaml.load(open(args.config, "r"), Loader=yaml.FullLoader)
if not config["dev"]:
GROQ_API_KEY = os.getenv('GROQ_API_KEY')
else:
GROQ_API_KEY = config.get("GROQ", {}).get("key")