zrguo commited on
Commit
191b01b
Β·
1 Parent(s): 5482815

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +31 -3
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
- If you want to use Ollama models, you only need to set LightRAG as follows:
 
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