From 21a5348a907950d84576051b0c365ff27f90d737 Mon Sep 17 00:00:00 2001 From: Wade Rosko <7385473+wrosko@users.noreply.github.com> Date: Fri, 18 Oct 2024 18:09:48 -0600 Subject: [PATCH] Add comment specifying jupyter req Add lines that can be uncommented if running in a jupyter notebook --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d0ed8a35..bd226582 100644 --- a/README.md +++ b/README.md @@ -47,12 +47,21 @@ pip install lightrag-hku ```bash curl https://raw.githubusercontent.com/gusye1234/nano-graphrag/main/tests/mock_data.txt > ./book.txt ``` -Use the below Python snippet to initialize LightRAG and perform queries: +Use the below Python snippet (in a script) to initialize LightRAG and perform queries: ```python from lightrag import LightRAG, QueryParam from lightrag.llm import gpt_4o_mini_complete, gpt_4o_complete +######### +# Uncomment the below two lines if running in a jupyter notebook to handle the async nature of rag.insert() +# import nest_asyncio +# nest_asyncio.apply() +######### + +WORKING_DIR = "./dickens" + + WORKING_DIR = "./dickens" if not os.path.exists(WORKING_DIR):