We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9c6b5ae commit de827abCopy full SHA for de827ab
lightrag/lightrag.py
@@ -628,11 +628,7 @@ async def ainsert_custom_chunks(
628
inserting_chunks: dict[str, Any] = {}
629
for index, chunk_text in enumerate(text_chunks):
630
chunk_key = compute_mdhash_id(chunk_text, prefix="chunk-")
631
- tokens = len(
632
- encode_string_by_tiktoken(
633
- chunk_text, model_name=self.tiktoken_model_name
634
- )
635
+ tokens = len(self.tokenizer.encode(chunk_text))
636
inserting_chunks[chunk_key] = {
637
"content": chunk_text,
638
"full_doc_id": doc_key,
0 commit comments