HKUDS / LightRAG

"LightRAG: Simple and Fast Retrieval-Augmented Generation"
https://arxiv.org/abs/2410.05779
MIT License
9.22k stars 1.13k forks source link

An error occurred: Extra data: line 21602 column 4 (char 18734083) #303

Open zel2023 opened 3 days ago

zel2023 commented 3 days ago

When I try to use LightRAG for a local query, I encounter the error: "An error occurred: Extra data: line 21602 column 4 (char 18734083)".

LarFii commented 2 days ago

This seems to be an issue with the JSON format. Did it occur during the query process? Do you have the full logs and code snippet available for debugging?

zel2023 commented 2 days ago

I just input a string, and set the prompt as follows: f''' xxx {string} xxx '''

However, the string itself is quite complex and may contain some escape characters. It seems that no other errors were reported, and no log file was generated.

zel2023 commented 2 days ago

I found this error occurred during initialization:

        embedding_dimension =  await get_embedding_dim()
        #print(f"Detected embedding dimension: {embedding_dimension}")

        rag = LightRAG(
            working_dir=WORKING_DIR,
            llm_model_func=llm_model_func,
            embedding_func=EmbeddingFunc(
                embedding_dim=embedding_dimension, max_token_size=8192, func=embedding_func
            ),
        )

I tried changing the WORKING_DIR, and the error no longer occurs.

image

zel2023 commented 2 days ago

I realized that I should have input JSON data the first time, which might have caused an issue with the cache. After that, inputting strings didn't work either.