Andrii Lazarchuk
commited on
Commit
·
a2724fe
1
Parent(s):
c276cbc
Fix lint issue
Browse files- examples/lightrag_ollama_demo.py +2 -3
- lightrag/lightrag.py +5 -1
examples/lightrag_ollama_demo.py
CHANGED
@@ -1,14 +1,13 @@
|
|
1 |
import os
|
2 |
import logging
|
3 |
-
|
4 |
-
logging.basicConfig(format="%(levelname)s:%(message)s", level=logging.INFO)
|
5 |
-
|
6 |
from lightrag import LightRAG, QueryParam
|
7 |
from lightrag.llm import ollama_model_complete, ollama_embedding
|
8 |
from lightrag.utils import EmbeddingFunc
|
9 |
|
10 |
WORKING_DIR = "./dickens"
|
11 |
|
|
|
|
|
12 |
if not os.path.exists(WORKING_DIR):
|
13 |
os.mkdir(WORKING_DIR)
|
14 |
|
|
|
1 |
import os
|
2 |
import logging
|
|
|
|
|
|
|
3 |
from lightrag import LightRAG, QueryParam
|
4 |
from lightrag.llm import ollama_model_complete, ollama_embedding
|
5 |
from lightrag.utils import EmbeddingFunc
|
6 |
|
7 |
WORKING_DIR = "./dickens"
|
8 |
|
9 |
+
logging.basicConfig(format="%(levelname)s:%(message)s", level=logging.INFO)
|
10 |
+
|
11 |
if not os.path.exists(WORKING_DIR):
|
12 |
os.mkdir(WORKING_DIR)
|
13 |
|
lightrag/lightrag.py
CHANGED
@@ -155,7 +155,11 @@ class LightRAG:
|
|
155 |
)
|
156 |
|
157 |
self.llm_model_func = limit_async_func_call(self.llm_model_max_async)(
|
158 |
-
partial(
|
|
|
|
|
|
|
|
|
159 |
)
|
160 |
|
161 |
def insert(self, string_or_strings):
|
|
|
155 |
)
|
156 |
|
157 |
self.llm_model_func = limit_async_func_call(self.llm_model_max_async)(
|
158 |
+
partial(
|
159 |
+
self.llm_model_func,
|
160 |
+
hashing_kv=self.llm_response_cache,
|
161 |
+
**self.llm_model_kwargs,
|
162 |
+
)
|
163 |
)
|
164 |
|
165 |
def insert(self, string_or_strings):
|