Skip to content

Commit

Permalink
fix issue: update document segment setting failed (#10107)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnJyong authored Oct 31, 2024
1 parent cee1c4f commit 0154a26
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/services/dataset_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,11 +736,12 @@ def save_document_with_dataset_id(
dataset.retrieval_model = document_data.get("retrieval_model") or default_retrieval_model

documents = []
batch = time.strftime("%Y%m%d%H%M%S") + str(random.randint(100000, 999999))
if document_data.get("original_document_id"):
document = DocumentService.update_document_with_dataset_id(dataset, document_data, account)
documents.append(document)
batch = document.batch
else:
batch = time.strftime("%Y%m%d%H%M%S") + str(random.randint(100000, 999999))
# save process rule
if not dataset_process_rule:
process_rule = document_data["process_rule"]
Expand Down Expand Up @@ -921,7 +922,7 @@ def save_document_with_dataset_id(
if duplicate_document_ids:
duplicate_document_indexing_task.delay(dataset.id, duplicate_document_ids)

return documents, batch
return documents, batch

@staticmethod
def check_documents_upload_quota(count: int, features: FeatureModel):
Expand Down

0 comments on commit 0154a26

Please sign in to comment.