dataintern commited on
Commit
ad9d2f6
·
1 Parent(s): 46a1571

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -133,7 +133,8 @@ def ask_ai_upload(doc, question):
133
 
134
  # Define the query & the querying method
135
  query_engine = index.as_query_engine(optimizer=SentenceEmbeddingOptimizer(percentile_cutoff=0.8), similarity_top_k=7)
136
- query = 'Answer the question truthfully based on the text provided. Include verbatim quote and after the quote write a step by step explanation. Use bullet points. Provide an answer as detailed and precise as possible. The task is:' + str(question) response = query_engine.query(query)
 
137
 
138
  return response.response
139
 
@@ -157,7 +158,8 @@ def ask_ai_choose(doc, question):
157
 
158
  # Define the query & the querying method
159
  query_engine = index.as_query_engine(optimizer=SentenceEmbeddingOptimizer(percentile_cutoff=0.8), similarity_top_k=7)
160
- query = 'Answer the question truthfully based on the text provided. Include verbatim quote and after the quote write a step by step explanation. Use bullet points. Provide an answer as detailed and precise as possible. The task is:' + str(question) response = query_engine.query(query)
 
161
 
162
  return response.response
163
 
 
133
 
134
  # Define the query & the querying method
135
  query_engine = index.as_query_engine(optimizer=SentenceEmbeddingOptimizer(percentile_cutoff=0.8), similarity_top_k=7)
136
+ query = 'Answer the question truthfully based on the text provided. Include verbatim quote and after the quote write a step by step explanation. Use bullet points. Provide an answer as detailed and precise as possible. The task is:' + str(question)
137
+ response = query_engine.query(query)
138
 
139
  return response.response
140
 
 
158
 
159
  # Define the query & the querying method
160
  query_engine = index.as_query_engine(optimizer=SentenceEmbeddingOptimizer(percentile_cutoff=0.8), similarity_top_k=7)
161
+ query = 'Answer the question truthfully based on the text provided. Include verbatim quote and after the quote write a step by step explanation. Use bullet points. Provide an answer as detailed and precise as possible. The task is:' + str(question)
162
+ response = query_engine.query(query)
163
 
164
  return response.response
165