zrguo
commited on
Commit
·
4225cbd
1
Parent(s):
b71997b
fix init
Browse files
docs/rerank_integration.md
CHANGED
@@ -144,6 +144,7 @@ Reranking is automatically applied at these key retrieval stages:
|
|
144 |
import asyncio
|
145 |
from lightrag import LightRAG, QueryParam
|
146 |
from lightrag.llm.openai import gpt_4o_mini_complete, openai_embedding
|
|
|
147 |
from lightrag.rerank import jina_rerank
|
148 |
|
149 |
async def my_rerank_func(query: str, documents: list, top_k: int = None, **kwargs):
|
@@ -167,6 +168,9 @@ async def main():
|
|
167 |
rerank_model_func=my_rerank_func,
|
168 |
)
|
169 |
|
|
|
|
|
|
|
170 |
# Insert documents
|
171 |
await rag.ainsert([
|
172 |
"Document 1 content...",
|
|
|
144 |
import asyncio
|
145 |
from lightrag import LightRAG, QueryParam
|
146 |
from lightrag.llm.openai import gpt_4o_mini_complete, openai_embedding
|
147 |
+
from lightrag.kg.shared_storage import initialize_pipeline_status
|
148 |
from lightrag.rerank import jina_rerank
|
149 |
|
150 |
async def my_rerank_func(query: str, documents: list, top_k: int = None, **kwargs):
|
|
|
168 |
rerank_model_func=my_rerank_func,
|
169 |
)
|
170 |
|
171 |
+
await rag.initialize_storages()
|
172 |
+
await initialize_pipeline_status()
|
173 |
+
|
174 |
# Insert documents
|
175 |
await rag.ainsert([
|
176 |
"Document 1 content...",
|