From 41b4c28430ae29eded99b62e82e1ad4b863e99a3 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 23 Dec 2024 17:41:44 +0000 Subject: [PATCH] fix: linting --- application/parser/chunking.py | 2 +- application/parser/embedding_pipeline.py | 4 ++-- application/worker.py | 2 -- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/application/parser/chunking.py b/application/parser/chunking.py index 26f05dba..aae14898 100644 --- a/application/parser/chunking.py +++ b/application/parser/chunking.py @@ -1,5 +1,5 @@ import re -from typing import List, Tuple, Union +from typing import List, Tuple import logging from application.parser.schema.base import Document from application.utils import get_encoding diff --git a/application/parser/embedding_pipeline.py b/application/parser/embedding_pipeline.py index 6cf40048..0435cd14 100755 --- a/application/parser/embedding_pipeline.py +++ b/application/parser/embedding_pipeline.py @@ -61,7 +61,7 @@ def embed_and_store_documents(docs, folder_name, source_id, task_status): # Process and embed documents for idx, doc in tqdm( - docs, + enumerate(docs), desc="Embedding 🦖", unit="docs", total=total_docs, @@ -69,7 +69,7 @@ def embed_and_store_documents(docs, folder_name, source_id, task_status): ): try: # Update task status for progress tracking - progress = int((idx / total_docs) * 100) + progress = int(((idx + 1) / total_docs) * 100) task_status.update_state(state="PROGRESS", meta={"current": progress}) # Add document to vector store diff --git a/application/worker.py b/application/worker.py index 0edb46ff..f4f181e5 100755 --- a/application/worker.py +++ b/application/worker.py @@ -126,7 +126,6 @@ def ingest_worker( limit = None exclude = True sample = False - token_check = True full_path = os.path.join(directory, user, name_job) logging.info(f"Ingest file: {full_path}", extra={"user": user, "job": name_job}) @@ -205,7 +204,6 @@ def remote_worker( operation_mode="upload", doc_id=None, ): - token_check = True full_path = os.path.join(directory, user, name_job) if not os.path.exists(full_path):