HKUDS / LightRAG

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

no current event loop in thread 'MainThread'. #214

Open gcl916 opened 1 day ago

gcl916 commented 1 day ago

INFO:lightrag:Logger initialized for working directory: ./dickens INFO:lightrag:Load KV full_docs with 0 data INFO:lightrag:Load KV text_chunks with 0 data INFO:lightrag:Load KV llm_response_cache with 0 data INFO:nano-vectordb:Init {'embedding_dim': 768, 'metric': 'cosine', 'storage_file': './dickens\vdb_entities.json'} 0 data INFO:nano-vectordb:Init {'embedding_dim': 768, 'metric': 'cosine', 'storage_file': './dickens\vdb_relationships.json'} 0 data INFO:nano-vectordb:Init {'embedding_dim': 768, 'metric': 'cosine', 'storage_file': './dickens\vdb_chunks.json'} 0 data

This is the readed txt content The Project Gutenberg eBook of A Christmas Carol

This ebook is for the use of anyone anywhere in the Unite

INFO:lightrag:Creating a new event loop in main thread. Traceback (most recent call last): File "e:\ollama\lightrag-main\lightrag\lightrag.py", line 58, in always_get_an_event_loop loop = asyncio.get_running_loop() ^^^^^^^^^^^^^^^^^^^^^^^^^^ RuntimeError: no running event loop

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "e:\Ollama\LightRAG-main\examples\lightrag_siliconcloud_demo.py", line 60, in rag.insert(f.read()) File "e:\ollama\lightrag-main\lightrag\lightrag.py", line 198, in insert loop = always_get_an_event_loop() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "e:\ollama\lightrag-main\lightrag\lightrag.py", line 63, in always_get_an_event_loop loop = asyncio.get_event_loop() ^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\aundf.conda\envs\ag\Lib\asyncio\events.py", line 681, in get_event_loop raise RuntimeError('There is no current event loop in thread %r.' RuntimeError: There is no current event loop in thread 'MainThread'.

JavieHush commented 13 hours ago

Already made a PR to fix this, check if it can run properly after the PR is accepted :)

JavieHush commented 12 hours ago

Already made a PR to fix this, check if it can run properly after the PR is accepted :)

This error probably happens when using local storage. Try use Neo4j instead. I found that Neo4j plugin got conflict with local naive storage, which will lead to this Error...

wiltshirek commented 3 hours ago

. @JavieHush , I made an additional edit to follow up on your PR. See #221