From cdd1d78bf2a383972af15921611a06e7efe53f93 Mon Sep 17 00:00:00 2001 From: Ja-sonYun Date: Sun, 18 Jun 2023 01:13:08 +0900 Subject: [PATCH] make modelname_to_contextsize as a staticmethod (#6040) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes ##6039 #### Before submitting #### Who can review? Tag maintainers/contributors who might be interested: @hwchase17 @agola11 --- langchain/llms/openai.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/langchain/llms/openai.py b/langchain/llms/openai.py index 172697a324..c0d999d42f 100644 --- a/langchain/llms/openai.py +++ b/langchain/llms/openai.py @@ -500,7 +500,8 @@ class BaseOpenAI(BaseLLM): disallowed_special=self.disallowed_special, ) - def modelname_to_contextsize(self, modelname: str) -> int: + @staticmethod + def modelname_to_contextsize(modelname: str) -> int: """Calculate the maximum number of tokens possible to generate for a model. Args: