소스 검색

fix: replicate text generation model validate (#923)

tags/0.3.15
takatost 2 년 전
부모
커밋
95b179fb39
No account linked to committer's email address
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2
    1
      api/core/model_providers/providers/replicate_provider.py

+ 2
- 1
api/core/model_providers/providers/replicate_provider.py 파일 보기

@@ -116,7 +116,8 @@ class ReplicateProvider(BaseModelProvider):
and 'Embedding' not in rst.openapi_schema['components']['schemas']:
raise CredentialsValidateFailedError(f"Model {model_name}:{version} is not a Embedding model.")
elif model_type == ModelType.TEXT_GENERATION \
and ('type' not in rst.openapi_schema['components']['schemas']['Output']['items']
and ('items' not in rst.openapi_schema['components']['schemas']['Output']
or 'type' not in rst.openapi_schema['components']['schemas']['Output']['items']
or rst.openapi_schema['components']['schemas']['Output']['items']['type'] != 'string'):
raise CredentialsValidateFailedError(f"Model {model_name}:{version} is not a Text Generation model.")
except ReplicateError as e:

Loading…
취소
저장