Skip to content

Commit

Permalink
Merge branch 'feat/model-runtime' into deploy/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeuoly committed Dec 28, 2023
2 parents aa543ea + 53bd2e1 commit 709fbdb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
}
Expand All @@ -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'),
},
Expand All @@ -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'),
},
Expand Down

0 comments on commit 709fbdb

Please sign in to comment.