fix get embedding model provider in empty dataset (#1986)

Co-authored-by: jyong <jyong@dify.ai>
This commit is contained in:
Jyong
2024-01-10 20:48:16 +08:00
committed by GitHub
parent 0025ba4921
commit 24bdedf802
3 changed files with 28 additions and 14 deletions

View File

@@ -69,9 +69,9 @@ class BaichuanTextEmbeddingModel(TextEmbeddingModel):
raise InsufficientAccountBalance(msg)
elif err == 'invalid_authentication':
raise InvalidAuthenticationError(msg)
elif 'rate' in err:
elif err and 'rate' in err:
raise RateLimitReachedError(msg)
elif 'internal' in err:
elif err and 'internal' in err:
raise InternalServerError(msg)
elif err == 'api_key_empty':
raise InvalidAPIKeyError(msg)