From 0b2ff45ed91690e34d07089038b0e561631496c6 Mon Sep 17 00:00:00 2001 From: kanak8278 Date: Thu, 25 Jul 2024 18:28:43 +0530 Subject: [PATCH] chore: Set GPT_MODEL environment variable in mini_llm.py --- env.template | 1 + nl2dsl/utils/mini_llm.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/env.template b/env.template index f0c2f88..824a841 100644 --- a/env.template +++ b/env.template @@ -1,4 +1,5 @@ OPENAI_API_KEY= +MODEL_NAME= #AZURE_OPENAI_API_KEY= #AZURE_OPENAI_ENDPOINT= diff --git a/nl2dsl/utils/mini_llm.py b/nl2dsl/utils/mini_llm.py index 6210cc9..4e17c44 100644 --- a/nl2dsl/utils/mini_llm.py +++ b/nl2dsl/utils/mini_llm.py @@ -15,8 +15,10 @@ else: client = OpenAI() -GPT_MODEL = "gpt-4-turbo" +GPT_MODEL = os.getenv('MODEL_NAME') +if GPT_MODEL is None: + raise EnvironmentError("MODEL_NAME environment variable is not set.") @retry(wait=wait_random_exponential(multiplier=1, max=40), stop=stop_after_attempt(10)) def mini_llm(utterance, model="gpt-4-turbo", temperature=0.3):