Skip to content

Commit

Permalink
Hardcode temperature
Browse files Browse the repository at this point in the history
  • Loading branch information
cecheta committed May 17, 2024
1 parent 036ee72 commit 87f80ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 1 addition & 3 deletions code/backend/batch/utilities/tools/question_answer_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ def answer_question(self, question: str, chat_history: list[dict], **kwargs):

llm_helper = LLMHelper()

response = llm_helper.get_chat_completion(
messages, temperature=float(self.env_helper.AZURE_OPENAI_TEMPERATURE)
)
response = llm_helper.get_chat_completion(messages, temperature=0)

answer = response.choices[0].message.content
logger.debug(f"Answer: {answer}")
Expand Down
9 changes: 4 additions & 5 deletions code/tests/utilities/tools/test_question_answer_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def env_helper_mock():
with patch("backend.batch.utilities.tools.question_answer_tool.EnvHelper") as mock:
env_helper = mock.return_value
env_helper.AZURE_OPENAI_SYSTEM_MESSAGE = "mock azure openai system message"
env_helper.AZURE_OPENAI_TEMPERATURE = "0.0"
env_helper.AZURE_SEARCH_TOP_K = 1
env_helper.AZURE_SEARCH_FILTER = "mock filter"
env_helper.AZURE_SEARCH_USE_INTEGRATED_VECTORIZATION = False
Expand Down Expand Up @@ -164,7 +163,7 @@ def test_correct_prompt_with_few_shot_example(llm_helper_mock: MagicMock):
"role": "user",
},
],
temperature=0.0,
temperature=0,
)


Expand Down Expand Up @@ -192,7 +191,7 @@ def test_correct_prompt_without_few_shot_example(
"role": "user",
},
],
temperature=0.0,
temperature=0,
)


Expand Down Expand Up @@ -231,7 +230,7 @@ def test_correct_prompt_with_few_shot_example_and_chat_history(
"role": "user",
},
],
temperature=0.0,
temperature=0,
)


Expand Down Expand Up @@ -261,7 +260,7 @@ def test_non_on_your_data_prompt_correct(
"role": "user",
},
],
temperature=0.0,
temperature=0,
)


Expand Down

0 comments on commit 87f80ab

Please sign in to comment.