Fix linting
This commit is contained in:
@@ -591,7 +591,7 @@ class LightRAG:
|
|||||||
if isinstance(input, str):
|
if isinstance(input, str):
|
||||||
input = [input]
|
input = [input]
|
||||||
|
|
||||||
# Clean input text and remove duplicates
|
# Clean input text and remove duplicates
|
||||||
input = list(set(self.clean_text(doc) for doc in input))
|
input = list(set(self.clean_text(doc) for doc in input))
|
||||||
|
|
||||||
# 1. Validate ids if provided or generate MD5 hash IDs
|
# 1. Validate ids if provided or generate MD5 hash IDs
|
||||||
@@ -608,10 +608,7 @@ class LightRAG:
|
|||||||
contents = {id_: doc for id_, doc in zip(ids, input)}
|
contents = {id_: doc for id_, doc in zip(ids, input)}
|
||||||
else:
|
else:
|
||||||
# Generate contents dict of MD5 hash IDs and documents
|
# Generate contents dict of MD5 hash IDs and documents
|
||||||
contents = {
|
contents = {compute_mdhash_id(doc, prefix="doc-"): doc for doc in input}
|
||||||
compute_mdhash_id(doc, prefix="doc-"): doc
|
|
||||||
for doc in input
|
|
||||||
}
|
|
||||||
|
|
||||||
# 2. Remove duplicate contents
|
# 2. Remove duplicate contents
|
||||||
unique_contents = {
|
unique_contents = {
|
||||||
|
Reference in New Issue
Block a user