zrguo
commited on
Commit
Β·
191b01b
1
Parent(s):
5482815
Update README.md
Browse files
README.md
CHANGED
@@ -92,7 +92,7 @@ print(rag.query("What are the top themes in this story?", param=QueryParam(mode=
|
|
92 |
<details>
|
93 |
<summary> Using Open AI-like APIs </summary>
|
94 |
|
95 |
-
LightRAG also supports Open AI-like chat/embeddings APIs:
|
96 |
```python
|
97 |
async def llm_model_func(
|
98 |
prompt, system_prompt=None, history_messages=[], **kwargs
|
@@ -130,7 +130,7 @@ rag = LightRAG(
|
|
130 |
<details>
|
131 |
<summary> Using Hugging Face Models </summary>
|
132 |
|
133 |
-
If you want to use Hugging Face models, you only need to set LightRAG as follows:
|
134 |
```python
|
135 |
from lightrag.llm import hf_model_complete, hf_embedding
|
136 |
from transformers import AutoModel, AutoTokenizer
|
@@ -156,7 +156,8 @@ rag = LightRAG(
|
|
156 |
|
157 |
<details>
|
158 |
<summary> Using Ollama Models </summary>
|
159 |
-
|
|
|
160 |
|
161 |
```python
|
162 |
from lightrag.llm import ollama_model_complete, ollama_embedding
|
@@ -177,6 +178,29 @@ rag = LightRAG(
|
|
177 |
),
|
178 |
)
|
179 |
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
180 |
</details>
|
181 |
|
182 |
### Batch Insert
|
@@ -441,6 +465,8 @@ def extract_queries(file_path):
|
|
441 |
βββ examples
|
442 |
β βββ batch_eval.py
|
443 |
β βββ generate_query.py
|
|
|
|
|
444 |
β βββ lightrag_hf_demo.py
|
445 |
β βββ lightrag_ollama_demo.py
|
446 |
β βββ lightrag_openai_compatible_demo.py
|
@@ -459,6 +485,8 @@ def extract_queries(file_path):
|
|
459 |
β βββ Step_1.py
|
460 |
β βββ Step_2.py
|
461 |
β βββ Step_3.py
|
|
|
|
|
462 |
βββ LICENSE
|
463 |
βββ README.md
|
464 |
βββ requirements.txt
|
|
|
92 |
<details>
|
93 |
<summary> Using Open AI-like APIs </summary>
|
94 |
|
95 |
+
* LightRAG also supports Open AI-like chat/embeddings APIs:
|
96 |
```python
|
97 |
async def llm_model_func(
|
98 |
prompt, system_prompt=None, history_messages=[], **kwargs
|
|
|
130 |
<details>
|
131 |
<summary> Using Hugging Face Models </summary>
|
132 |
|
133 |
+
* If you want to use Hugging Face models, you only need to set LightRAG as follows:
|
134 |
```python
|
135 |
from lightrag.llm import hf_model_complete, hf_embedding
|
136 |
from transformers import AutoModel, AutoTokenizer
|
|
|
156 |
|
157 |
<details>
|
158 |
<summary> Using Ollama Models </summary>
|
159 |
+
|
160 |
+
* If you want to use Ollama models, you only need to set LightRAG as follows:
|
161 |
|
162 |
```python
|
163 |
from lightrag.llm import ollama_model_complete, ollama_embedding
|
|
|
178 |
),
|
179 |
)
|
180 |
```
|
181 |
+
|
182 |
+
* Increasing the `num_ctx` parameter:
|
183 |
+
|
184 |
+
1. Pull the model:
|
185 |
+
```python
|
186 |
+
ollama pull qwen2
|
187 |
+
```
|
188 |
+
|
189 |
+
2. Display the model file:
|
190 |
+
```python
|
191 |
+
ollama show --modelfile qwen2 > Modelfile
|
192 |
+
```
|
193 |
+
|
194 |
+
3. Edit the Modelfile by adding the following line:
|
195 |
+
```python
|
196 |
+
PARAMETER num_ctx 32768
|
197 |
+
```
|
198 |
+
|
199 |
+
4. Create the modified model:
|
200 |
+
```python
|
201 |
+
ollama create -f Modelfile qwen2m
|
202 |
+
```
|
203 |
+
|
204 |
</details>
|
205 |
|
206 |
### Batch Insert
|
|
|
465 |
βββ examples
|
466 |
β βββ batch_eval.py
|
467 |
β βββ generate_query.py
|
468 |
+
β βββ lightrag_azure_openai_demo.py
|
469 |
+
β βββ lightrag_bedrock_demo.py
|
470 |
β βββ lightrag_hf_demo.py
|
471 |
β βββ lightrag_ollama_demo.py
|
472 |
β βββ lightrag_openai_compatible_demo.py
|
|
|
485 |
β βββ Step_1.py
|
486 |
β βββ Step_2.py
|
487 |
β βββ Step_3.py
|
488 |
+
βββ .gitignore
|
489 |
+
βββ .pre-commit-config.yaml
|
490 |
βββ LICENSE
|
491 |
βββ README.md
|
492 |
βββ requirements.txt
|