From 701d8bb48e3e3224b357e677c5bde042963dc0de Mon Sep 17 00:00:00 2001 From: Lukas Selch Date: Wed, 19 Feb 2025 10:28:25 +0100 Subject: [PATCH] Applied lint --- lightrag/lightrag.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lightrag/lightrag.py b/lightrag/lightrag.py index 8513ac19..e73e4c1b 100644 --- a/lightrag/lightrag.py +++ b/lightrag/lightrag.py @@ -862,8 +862,16 @@ class LightRAG: for chunk_data in custom_kg.get("chunks", {}): chunk_content = chunk_data["content"].strip() source_id = chunk_data["source_id"] - tokens = len(encode_string_by_tiktoken(chunk_content, model_name=self.tiktoken_model_name)) - chunk_order_index = 0 if "chunk_order_index" not in chunk_data.keys() else chunk_data["chunk_order_index"] + tokens = len( + encode_string_by_tiktoken( + chunk_content, model_name=self.tiktoken_model_name + ) + ) + chunk_order_index = ( + 0 + if "chunk_order_index" not in chunk_data.keys() + else chunk_data["chunk_order_index"] + ) chunk_id = compute_mdhash_id(chunk_content, prefix="chunk-") chunk_entry = {