Skip to content

Commit

Permalink
fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyongchao committed Dec 19, 2024
1 parent 7640161 commit bf77195
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lazyllm/tools/rag/doc_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def _add_files(self, input_files: List[str], ids: Optional[List[str]] = None,
root_nodes = self._reader.load_data(input_files)
for idx, node in enumerate(root_nodes):
node.global_metadata = metadatas[idx].copy() if metadatas else {}
node.global_metadata[RAG_DOC_ID] = ids[idx] if ids else gen_docid(input_files[idx])
node.global_metadata[RAG_DOC_ID] = ids[idx] if ids else gen_docid(input_files[idx])
node.global_metadata[RAG_DOC_PATH] = input_files[idx]
temp_store = self._create_store({"type": "map"})
temp_store.update_nodes(root_nodes)
Expand Down
6 changes: 3 additions & 3 deletions lazyllm/tools/rag/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
from lazyllm.common.queue import sqlite3_check_threadsafety
import sqlalchemy
from sqlalchemy.orm import DeclarativeBase
from sqlalchemy import Column, insert, update, select, delete
from sqlalchemy import Column, insert, update
from sqlalchemy.orm import sessionmaker
import uuid

import pydantic
import sqlite3
Expand Down Expand Up @@ -101,6 +100,7 @@ class Status:
deleted = 'deleted'

DELETE_SAFE_STATUS_LIST = [Status.waiting, Status.success, Status.failed]

def __init__(self, path, name):
self._path = path
self._name = name
Expand Down Expand Up @@ -480,7 +480,7 @@ def update_file_status(self, file_ids: List[str], status: str, batch_size: int =
updated_files = []

for i in range(0, len(file_ids), batch_size):
batch = file_ids[i : i + batch_size]
batch = file_ids[i: i + batch_size]
placeholders = ', '.join('?' for _ in batch)
sql = f'UPDATE documents SET status = ? WHERE doc_id IN ({placeholders}) RETURNING doc_id, path'

Expand Down

0 comments on commit bf77195

Please sign in to comment.