From 190daa2b57f22463c793bcbc3d46959329ba8bf7 Mon Sep 17 00:00:00 2001 From: crazywoola <427733928@qq.com> Date: Tue, 10 Sep 2024 12:44:46 +0800 Subject: [PATCH] fix: lint --- api/controllers/console/datasets/datasets_document.py | 6 ++---- api/services/dataset_service.py | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/api/controllers/console/datasets/datasets_document.py b/api/controllers/console/datasets/datasets_document.py index 87c4edc1589f5c..076f3cd44d5af5 100644 --- a/api/controllers/console/datasets/datasets_document.py +++ b/api/controllers/console/datasets/datasets_document.py @@ -302,10 +302,8 @@ def post(self): "doc_language", type=str, default="English", required=False, nullable=False, location="json" ) parser.add_argument("retrieval_model", type=dict, required=False, nullable=False, location="json") - parser.add_argument("embedding_model", type=str, required=False, nullable=True, - location="json") - parser.add_argument("embedding_model_provider", type=str, required=False, nullable=True, - location="json") + parser.add_argument("embedding_model", type=str, required=False, nullable=True, location="json") + parser.add_argument("embedding_model_provider", type=str, required=False, nullable=True, location="json") args = parser.parse_args() # The role of the current user in the ta table must be admin, owner, or editor, or dataset_operator diff --git a/api/services/dataset_service.py b/api/services/dataset_service.py index 4e09bcde9563c1..cce0874cf4f9b2 100644 --- a/api/services/dataset_service.py +++ b/api/services/dataset_service.py @@ -1058,8 +1058,7 @@ def save_document_without_dataset_id(tenant_id: str, document_data: dict, accoun retrieval_model = None if document_data["indexing_technique"] == "high_quality": dataset_collection_binding = DatasetCollectionBindingService.get_dataset_collection_binding( - document_data['embedding_model_provider'], - document_data['embedding_model'] + document_data["embedding_model_provider"], document_data["embedding_model"] ) dataset_collection_binding_id = dataset_collection_binding.id if document_data.get("retrieval_model"):