Bladeren bron

fix: replicate text generation model validate (#923)

tags/0.3.15
takatost 2 jaren geleden
bovenliggende
commit
95b179fb39
No account linked to committer's email address
1 gewijzigde bestanden met toevoegingen van 2 en 1 verwijderingen
  1. 2
    1
      api/core/model_providers/providers/replicate_provider.py

+ 2
- 1
api/core/model_providers/providers/replicate_provider.py Bestand weergeven

and 'Embedding' not in rst.openapi_schema['components']['schemas']: and 'Embedding' not in rst.openapi_schema['components']['schemas']:
raise CredentialsValidateFailedError(f"Model {model_name}:{version} is not a Embedding model.") raise CredentialsValidateFailedError(f"Model {model_name}:{version} is not a Embedding model.")
elif model_type == ModelType.TEXT_GENERATION \ 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'): or rst.openapi_schema['components']['schemas']['Output']['items']['type'] != 'string'):
raise CredentialsValidateFailedError(f"Model {model_name}:{version} is not a Text Generation model.") raise CredentialsValidateFailedError(f"Model {model_name}:{version} is not a Text Generation model.")
except ReplicateError as e: except ReplicateError as e:

Laden…
Annuleren
Opslaan