Spaces:
Build error
Build error
heikowagner
commited on
Commit
·
1f3a255
1
Parent(s):
3ad0959
Update app/load_model.py
Browse files- app/load_model.py +2 -2
app/load_model.py
CHANGED
@@ -114,9 +114,9 @@ def load_vectorstore(model_name, collection, metadata):
|
|
114 |
)
|
115 |
return vectorstore
|
116 |
|
117 |
-
def create_chain(_llm, collection, model_name, metadata):
|
118 |
vectorstore = load_vectorstore(model_name, collection, metadata=metadata)
|
119 |
-
retriever = vectorstore.as_retriever(search_kwargs={"k":
|
120 |
chain = RetrievalQA.from_chain_type(llm=_llm, chain_type="stuff", retriever=retriever, return_source_documents=True)
|
121 |
return chain
|
122 |
# %%
|
|
|
114 |
)
|
115 |
return vectorstore
|
116 |
|
117 |
+
def create_chain(_llm, collection, model_name, metadata,k=4):
|
118 |
vectorstore = load_vectorstore(model_name, collection, metadata=metadata)
|
119 |
+
retriever = vectorstore.as_retriever(search_kwargs={"k": k})
|
120 |
chain = RetrievalQA.from_chain_type(llm=_llm, chain_type="stuff", retriever=retriever, return_source_documents=True)
|
121 |
return chain
|
122 |
# %%
|