Update functions.py
Browse files- functions.py +3 -3
functions.py
CHANGED
@@ -155,7 +155,7 @@ def gen_embeddings(embedding_model):
|
|
155 |
return embeddings
|
156 |
|
157 |
@st.experimental_memo(suppress_st_warning=True)
|
158 |
-
def embed_text(query,corpus,title,embedding_model,_emb_tok,
|
159 |
|
160 |
'''Embed text and generate semantic search scores'''
|
161 |
|
@@ -165,7 +165,7 @@ def embed_text(query,corpus,title,embedding_model,_emb_tok,_chain_type):
|
|
165 |
|
166 |
docs = docsearch.similarity_search_with_score(query, k=3)
|
167 |
|
168 |
-
if
|
169 |
|
170 |
docs = [d[0] for d in docs]
|
171 |
|
@@ -181,7 +181,7 @@ def embed_text(query,corpus,title,embedding_model,_emb_tok,_chain_type):
|
|
181 |
answer = chain({"input_documents": docs, "question": query}, return_only_outputs=False)
|
182 |
|
183 |
|
184 |
-
elif
|
185 |
|
186 |
docs = [d[0] for d in docs]
|
187 |
|
|
|
155 |
return embeddings
|
156 |
|
157 |
@st.experimental_memo(suppress_st_warning=True)
|
158 |
+
def embed_text(query,corpus,title,embedding_model,_emb_tok,chain_type):
|
159 |
|
160 |
'''Embed text and generate semantic search scores'''
|
161 |
|
|
|
165 |
|
166 |
docs = docsearch.similarity_search_with_score(query, k=3)
|
167 |
|
168 |
+
if chain_type == 'Normal':
|
169 |
|
170 |
docs = [d[0] for d in docs]
|
171 |
|
|
|
181 |
answer = chain({"input_documents": docs, "question": query}, return_only_outputs=False)
|
182 |
|
183 |
|
184 |
+
elif chain_type == 'Refined':
|
185 |
|
186 |
docs = [d[0] for d in docs]
|
187 |
|