Spaces:
Running
Running
蒲源
commited on
Commit
•
f62e186
1
Parent(s):
5d76dc2
polish(pu): change default model from gpt to kimi
Browse files- rag_demo.py +3 -3
rag_demo.py
CHANGED
@@ -74,7 +74,7 @@ def get_retriever(vectorstore, k=4):
|
|
74 |
return vectorstore.as_retriever(search_kwargs={'k': k})
|
75 |
|
76 |
|
77 |
-
def setup_rag_chain(model_name="
|
78 |
"""设置检索增强生成流程"""
|
79 |
if model_name.startswith("gpt"):
|
80 |
# 如果是以gpt开头的模型,使用原来的逻辑
|
@@ -101,7 +101,7 @@ def setup_rag_chain(model_name="gpt-4", temperature=0):
|
|
101 |
|
102 |
|
103 |
# 执行查询并打印结果
|
104 |
-
def execute_query(retriever, rag_chain, query, model_name="
|
105 |
"""
|
106 |
执行查询并返回结果及检索到的文档块
|
107 |
|
@@ -145,7 +145,7 @@ def execute_query(retriever, rag_chain, query, model_name="gpt-4", temperature=0
|
|
145 |
return retrieved_documents, response_text
|
146 |
|
147 |
|
148 |
-
def execute_query_no_rag(model_name="
|
149 |
"""执行无 RAG 链的查询"""
|
150 |
if model_name.startswith("gpt"):
|
151 |
# 如果是以gpt开头的模型,使用原来的逻辑
|
|
|
74 |
return vectorstore.as_retriever(search_kwargs={'k': k})
|
75 |
|
76 |
|
77 |
+
def setup_rag_chain(model_name="kimi", temperature=0):
|
78 |
"""设置检索增强生成流程"""
|
79 |
if model_name.startswith("gpt"):
|
80 |
# 如果是以gpt开头的模型,使用原来的逻辑
|
|
|
101 |
|
102 |
|
103 |
# 执行查询并打印结果
|
104 |
+
def execute_query(retriever, rag_chain, query, model_name="kimi", temperature=0):
|
105 |
"""
|
106 |
执行查询并返回结果及检索到的文档块
|
107 |
|
|
|
145 |
return retrieved_documents, response_text
|
146 |
|
147 |
|
148 |
+
def execute_query_no_rag(model_name="kimi", temperature=0, query=""):
|
149 |
"""执行无 RAG 链的查询"""
|
150 |
if model_name.startswith("gpt"):
|
151 |
# 如果是以gpt开头的模型,使用原来的逻辑
|