From d1f8249a1c97ee15def08f21c0bb110cd6a31a40 Mon Sep 17 00:00:00 2001 From: niliy01 Date: Thu, 21 Nov 2024 13:25:37 +0800 Subject: [PATCH] fix: remove repeated completion assignment in llm.py This duplicate code is introduced here: https://github.com/All-Hands-AI/OpenHands/pull/4722/files#diff-b46ec9dd4b319d75809520e34b2559fd2ce46ca4895709eae9312aa04a8fa9a, delete it --- openhands/llm/llm.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/openhands/llm/llm.py b/openhands/llm/llm.py index 2191818f8216..58f41ca46244 100644 --- a/openhands/llm/llm.py +++ b/openhands/llm/llm.py @@ -108,20 +108,8 @@ def __init__( ) os.makedirs(self.config.log_completions_folder, exist_ok=True) - self._completion = partial( - litellm_completion, - model=self.config.model, - api_key=self.config.api_key, - base_url=self.config.base_url, - api_version=self.config.api_version, - custom_llm_provider=self.config.custom_llm_provider, - max_tokens=self.config.max_output_tokens, - timeout=self.config.timeout, - temperature=self.config.temperature, - top_p=self.config.top_p, - drop_params=self.config.drop_params, - ) - + # call init_model_info to initialize config.max_output_tokens + # which is used in partial function with warnings.catch_warnings(): warnings.simplefilter('ignore') self.init_model_info()