embedding model check when init the knowledge (#10463)

This commit is contained in:
Jyong 2024-11-08 17:14:56 +08:00 committed by GitHub
parent 7c2a9b0744
commit d52c750942
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -317,8 +317,11 @@ class DatasetInitApi(Resource):
raise ValueError("embedding model and embedding model provider are required for high quality indexing.")
try:
model_manager = ModelManager()
model_manager.get_default_model_instance(
tenant_id=current_user.current_tenant_id, model_type=ModelType.TEXT_EMBEDDING
model_manager.get_model_instance(
tenant_id=current_user.current_tenant_id,
provider=args["embedding_model_provider"],
model_type=ModelType.TEXT_EMBEDDING,
model=args["embedding_model"],
)
except InvokeAuthorizationError:
raise ProviderNotInitializeError(