From b11c33d7a1b1987873885b817ccd0c6a6050bd69 Mon Sep 17 00:00:00 2001 From: yangdx Date: Wed, 15 Jan 2025 01:25:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dembedding=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E7=BA=AC=E5=BA=A6=E6=95=B0=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/lightrag_yangdx.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/lightrag_yangdx.py b/examples/lightrag_yangdx.py index 72f42cc4..eeb651f8 100644 --- a/examples/lightrag_yangdx.py +++ b/examples/lightrag_yangdx.py @@ -9,7 +9,7 @@ from lightrag.utils import EmbeddingFunc load_dotenv() -WORKING_DIR = "./examples/input" +WORKING_DIR = "./examples/output" logging.basicConfig(format="%(levelname)s:%(message)s", level=logging.INFO) @@ -22,7 +22,7 @@ async def llm_model_func( system_prompt=system_prompt, history_messages=history_messages, api_key=os.getenv("DEEPSEEK_API_KEY"), - base_url=os.getenv("DEEPSEEK__ENDPOINT"), + base_url=os.getenv("DEEPSEEK_ENDPOINT"), **kwargs, ) @@ -33,15 +33,15 @@ rag = LightRAG( working_dir=WORKING_DIR, llm_model_func=llm_model_func, embedding_func=EmbeddingFunc( - embedding_dim=768, + embedding_dim=1024, max_token_size=8192, func=lambda texts: ollama_embedding( - texts, embed_model="nomic-embed-text", host="http://m4.lan.znipower.com:11434" + texts, embed_model="bge-m3:latest", host="http://m4.lan.znipower.com:11434" ), ), ) -with open("./input/book.txt", "r", encoding="utf-8") as f: +with open("./examples/input/book.txt", "r", encoding="utf-8") as f: rag.insert(f.read()) # Perform naive search