nickmuchi commited on
Commit
de88316
·
1 Parent(s): 7cbb14d

Update functions.py

Browse files
Files changed (1) hide show
  1. 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,_chain_type):
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 _chain_type == 'Normal':
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 _chain_type == 'Refined':
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