Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

embedding model check when init the knowledge (#10463)

Jyongd52c750942a4
diff --git a/api/controllers/console/datasets/datasets_document.py b/api/controllers/console/datasets/datasets_document.py
index 6d6886fcb89..60848039c52 100644
--- a/api/controllers/console/datasets/datasets_document.py
+++ b/api/controllers/console/datasets/datasets_document.py
@@ -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(