From ecc7f130b45b8717869a748330960adc28a07253 Mon Sep 17 00:00:00 2001 From: Pika Date: Wed, 12 Jun 2024 17:01:21 +0800 Subject: [PATCH] fix(typo): misspelling (#5094) --- .../model_providers/localai/llm/llm.py | 2 +- .../model_runtime/localai/test_llm.py | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/api/core/model_runtime/model_providers/localai/llm/llm.py b/api/core/model_runtime/model_providers/localai/llm/llm.py index 161e65302f..2a3fbb5c57 100644 --- a/api/core/model_runtime/model_providers/localai/llm/llm.py +++ b/api/core/model_runtime/model_providers/localai/llm/llm.py @@ -50,7 +50,7 @@ from core.model_runtime.model_providers.__base.large_language_model import Large from core.model_runtime.utils import helper -class LocalAILarguageModel(LargeLanguageModel): +class LocalAILanguageModel(LargeLanguageModel): def _invoke(self, model: str, credentials: dict, prompt_messages: list[PromptMessage], model_parameters: dict, tools: list[PromptMessageTool] | None = None, stop: list[str] | None = None, diff --git a/api/tests/integration_tests/model_runtime/localai/test_llm.py b/api/tests/integration_tests/model_runtime/localai/test_llm.py index 208959815c..6f421403d4 100644 --- a/api/tests/integration_tests/model_runtime/localai/test_llm.py +++ b/api/tests/integration_tests/model_runtime/localai/test_llm.py @@ -13,11 +13,11 @@ from core.model_runtime.entities.message_entities import ( ) from core.model_runtime.entities.model_entities import ParameterRule from core.model_runtime.errors.validate import CredentialsValidateFailedError -from core.model_runtime.model_providers.localai.llm.llm import LocalAILarguageModel +from core.model_runtime.model_providers.localai.llm.llm import LocalAILanguageModel def test_validate_credentials_for_chat_model(): - model = LocalAILarguageModel() + model = LocalAILanguageModel() with pytest.raises(CredentialsValidateFailedError): model.validate_credentials( @@ -37,7 +37,7 @@ def test_validate_credentials_for_chat_model(): ) def test_invoke_completion_model(): - model = LocalAILarguageModel() + model = LocalAILanguageModel() response = model.invoke( model='chinese-llama-2-7b', @@ -65,7 +65,7 @@ def test_invoke_completion_model(): assert response.usage.total_tokens > 0 def test_invoke_chat_model(): - model = LocalAILarguageModel() + model = LocalAILanguageModel() response = model.invoke( model='chinese-llama-2-7b', @@ -93,7 +93,7 @@ def test_invoke_chat_model(): assert response.usage.total_tokens > 0 def test_invoke_stream_completion_model(): - model = LocalAILarguageModel() + model = LocalAILanguageModel() response = model.invoke( model='chinese-llama-2-7b', @@ -124,7 +124,7 @@ def test_invoke_stream_completion_model(): assert len(chunk.delta.message.content) > 0 if chunk.delta.finish_reason is None else True def test_invoke_stream_chat_model(): - model = LocalAILarguageModel() + model = LocalAILanguageModel() response = model.invoke( model='chinese-llama-2-7b', @@ -155,7 +155,7 @@ def test_invoke_stream_chat_model(): assert len(chunk.delta.message.content) > 0 if chunk.delta.finish_reason is None else True def test_get_num_tokens(): - model = LocalAILarguageModel() + model = LocalAILanguageModel() num_tokens = model.get_num_tokens( model='????', @@ -215,4 +215,4 @@ def test_get_num_tokens(): ) assert isinstance(num_tokens, int) - assert num_tokens == 10 \ No newline at end of file + assert num_tokens == 10