diff --git a/api/core/model_runtime/model_providers/baichuan/text_embedding/text_embedding.py b/api/core/model_runtime/model_providers/baichuan/text_embedding/text_embedding.py index 6a40466db8c3c1..8847e020b610b6 100644 --- a/api/core/model_runtime/model_providers/baichuan/text_embedding/text_embedding.py +++ b/api/core/model_runtime/model_providers/baichuan/text_embedding/text_embedding.py @@ -34,7 +34,7 @@ def _invoke(self, model: str, credentials: dict, :return: embeddings result """ api_key = credentials['api_key'] - if model != 'baichuang-text-embedding': + if model != 'baichuan-text-embedding': raise ValueError('Invalid model name') if not api_key: raise CredentialsValidateFailedError('api_key is required') diff --git a/api/tests/integration_tests/model_runtime/baichuan/test_text_embedding.py b/api/tests/integration_tests/model_runtime/baichuan/test_text_embedding.py index ae31c0db29738b..b6d806df022e64 100644 --- a/api/tests/integration_tests/model_runtime/baichuan/test_text_embedding.py +++ b/api/tests/integration_tests/model_runtime/baichuan/test_text_embedding.py @@ -11,14 +11,14 @@ def test_validate_credentials(): with pytest.raises(CredentialsValidateFailedError): model.validate_credentials( - model='baichuang-text-embedding', + model='baichuan-text-embedding', credentials={ 'api_key': 'invalid_key' } ) model.validate_credentials( - model='baichuang-text-embedding', + model='baichuan-text-embedding', credentials={ 'api_key': os.environ.get('BAICHUAN_API_KEY') } @@ -29,7 +29,7 @@ def test_invoke_model(): model = BaichuanTextEmbeddingModel() result = model.invoke( - model='baichuang-text-embedding', + model='baichuan-text-embedding', credentials={ 'api_key': os.environ.get('BAICHUAN_API_KEY'), }, @@ -48,7 +48,7 @@ def test_get_num_tokens(): model = BaichuanTextEmbeddingModel() num_tokens = model.get_num_tokens( - model='baichuang-text-embedding', + model='baichuan-text-embedding', credentials={ 'api_key': os.environ.get('BAICHUAN_API_KEY'), },