Spaces:
Build error
Build error
minor update
Browse filesadded search parameter k into config
- code/config.yml +1 -0
- code/modules/llm_tutor.py +2 -2
code/config.yml
CHANGED
@@ -5,6 +5,7 @@ embedding_options:
|
|
5 |
db_option : 'FAISS' # str
|
6 |
db_path : 'vectorstores' # str
|
7 |
model : 'sentence-transformers/all-MiniLM-L6-v2' # str [sentence-transformers/all-MiniLM-L6-v2, text-embedding-ada-002']
|
|
|
8 |
llm_params:
|
9 |
use_history: True # bool
|
10 |
llm_loader: 'openai' # str [ctransformers, openai]
|
|
|
5 |
db_option : 'FAISS' # str
|
6 |
db_path : 'vectorstores' # str
|
7 |
model : 'sentence-transformers/all-MiniLM-L6-v2' # str [sentence-transformers/all-MiniLM-L6-v2, text-embedding-ada-002']
|
8 |
+
search_top_k : 5 # int
|
9 |
llm_params:
|
10 |
use_history: True # bool
|
11 |
llm_loader: 'openai' # str [ctransformers, openai]
|
code/modules/llm_tutor.py
CHANGED
@@ -47,7 +47,7 @@ class LLMTutor:
|
|
47 |
qa_chain = ConversationalRetrievalChain.from_llm(
|
48 |
llm=llm,
|
49 |
chain_type="stuff",
|
50 |
-
retriever=db.as_retriever(search_kwargs={"k":
|
51 |
return_source_documents=True,
|
52 |
memory=memory,
|
53 |
combine_docs_chain_kwargs={"prompt": prompt},
|
@@ -56,7 +56,7 @@ class LLMTutor:
|
|
56 |
qa_chain = RetrievalQA.from_chain_type(
|
57 |
llm=llm,
|
58 |
chain_type="stuff",
|
59 |
-
retriever=db.as_retriever(search_kwargs={"k":
|
60 |
return_source_documents=True,
|
61 |
chain_type_kwargs={"prompt": prompt},
|
62 |
)
|
|
|
47 |
qa_chain = ConversationalRetrievalChain.from_llm(
|
48 |
llm=llm,
|
49 |
chain_type="stuff",
|
50 |
+
retriever=db.as_retriever(search_kwargs={"k": self.config["embedding_options"]["search_top_k"]}),
|
51 |
return_source_documents=True,
|
52 |
memory=memory,
|
53 |
combine_docs_chain_kwargs={"prompt": prompt},
|
|
|
56 |
qa_chain = RetrievalQA.from_chain_type(
|
57 |
llm=llm,
|
58 |
chain_type="stuff",
|
59 |
+
retriever=db.as_retriever(search_kwargs={"k": self.config["embedding_options"]["search_top_k"]}),
|
60 |
return_source_documents=True,
|
61 |
chain_type_kwargs={"prompt": prompt},
|
62 |
)
|