From 35758f13030223ccfccffbf59fde82edf0007e43 Mon Sep 17 00:00:00 2001 From: Vincent Emonet Date: Mon, 21 Oct 2024 13:00:50 +0200 Subject: [PATCH] fix env var --- backend/src/mapping_generation/manager_llm.py | 10 +++++----- backend/src/upload.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/src/mapping_generation/manager_llm.py b/backend/src/mapping_generation/manager_llm.py index 48fc62c..2a4a7f8 100644 --- a/backend/src/mapping_generation/manager_llm.py +++ b/backend/src/mapping_generation/manager_llm.py @@ -33,12 +33,12 @@ def get_instance(model="llama", hugging_face=False): def _load_llm(model="llama3", hugging_face=False): load_dotenv() # open_ai_key = os.getenv("OPENAI_API_KEY") - my_openai_key = os.getenv("CT_MAPPER_OPENAI_API_KEY") + my_openai_key = os.getenv("CT_MAPPER_OPENAI_API_KEY", "") # org_id = os.getenv("OPENAI_ORG_ID") - my_org_id = os.getenv("CT_MAPPER_OPENAI_ORG_ID") - groq_api = os.getenv("GROQ_API_KEY") - togather_api = os.getenv("TOGATHER_API_KEY") - hf_key = os.getenv("HF_API_KEY") + my_org_id = os.getenv("CT_MAPPER_OPENAI_ORG_ID", "") + groq_api = os.getenv("GROQ_API_KEY", "") + togather_api = os.getenv("TOGATHER_API_KEY", "") + hf_key = os.getenv("HF_API_KEY", "") # mixtral_api = os.getenv("MIXTRAL_API_KEY") if hugging_face and "gpt" not in model: if model == "llama": diff --git a/backend/src/upload.py b/backend/src/upload.py index 7ab3b6f..a1d6c03 100644 --- a/backend/src/upload.py +++ b/backend/src/upload.py @@ -408,7 +408,7 @@ async def upload_cohort( ) # NOTE: waiting for more tests before sending to production - background_tasks.add_task(generate_mappings, cohort_id, metadata_path, g) + # background_tasks.add_task(generate_mappings, cohort_id, metadata_path, g) # TODO: move all the "delete_existing_triples" and "publish_graph_to_endpoint" logic to the background task after mappings have been generated # Delete previous graph for this file from triplestore