Skip to content

Commit

Permalink
embedding model check when init the knowledge (langgenius#10463)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnJyong authored and jiangzhijie committed Nov 14, 2024
1 parent b142c29 commit dbf14ba
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions api/controllers/console/datasets/datasets_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,8 +317,11 @@ def post(self):
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(
Expand Down

0 comments on commit dbf14ba

Please sign in to comment.