From 3ab726f9612565568e634738eee575732dbcabc8 Mon Sep 17 00:00:00 2001 From: Geens Date: Thu, 9 Jan 2025 20:01:32 +0100 Subject: [PATCH] Properly close mistral response --- sia/mistral_llm_engine.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sia/mistral_llm_engine.py b/sia/mistral_llm_engine.py index 68504be..ea002ef 100644 --- a/sia/mistral_llm_engine.py +++ b/sia/mistral_llm_engine.py @@ -46,12 +46,12 @@ class MistralLlmEngine(LlmEngine): try: for chunk in stream_response: if should_stop(): - stream_response.close() + stream_response.response.close() break if content := chunk.data.choices[0].delta.content: yield content finally: - stream_response.close() + stream_response.response.close() def token_count(self, system_prompt: str, main_context: str) -> int: messages = [