'commit'
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import asyncio
|
||||
|
||||
from raganything import RAGAnything, RAGAnythingConfig
|
||||
from lightrag.llm.openai import openai_complete_if_cache, openai_embed
|
||||
from lightrag.utils import EmbeddingFunc
|
||||
@@ -94,6 +95,15 @@ async def main():
|
||||
base_url=Config.Config.EMBED_BASE_URL,
|
||||
),
|
||||
)
|
||||
from functools import partial
|
||||
from lightrag.rerank import cohere_rerank
|
||||
|
||||
rerank_model_func = partial(
|
||||
cohere_rerank,
|
||||
model=Config.Config.RERANK_MODEL,
|
||||
api_key=Config.Config.RERANK_BINDING_API_KEY,
|
||||
base_url=Config.Config.RERANK_BASE_URL,
|
||||
)
|
||||
|
||||
# 初始化 RAGAnything
|
||||
rag = RAGAnything(
|
||||
@@ -101,6 +111,7 @@ async def main():
|
||||
llm_model_func=llm_model_func,
|
||||
vision_model_func=vision_model_func,
|
||||
embedding_func=embedding_func,
|
||||
#rerank_model_func=rerank_model_func,
|
||||
)
|
||||
|
||||
# 处理文档
|
||||
|
Reference in New Issue
Block a user