devve1 commited on
Commit
48c085d
1 Parent(s): caaab2a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -14
app.py CHANGED
@@ -358,20 +358,6 @@ if __name__ == '__main__':
358
  )
359
  st.title('Multipurpose AI Agent')
360
  #st.markdown("<h1 style='position: fixed; top: 0; left: 0; width: 100%; padding: 10px; text-align: left; color: black;'>Multipurpose AI Agent</h1>", unsafe_allow_html=True)
361
-
362
- if "qa_prompt" not in st.session_state:
363
- st.session_state.qa_prompt = lambda query, context: (
364
- f"""You are an assistant for question-answering tasks. Use the following pieces of retrieved context to answer the question. If you don't know the answer, reply with 'no_answer'. Use three sentences maximum and keep the answer concise.
365
-
366
- Question: {query}
367
-
368
- Context: {context}
369
-
370
- Answer:"""
371
- )
372
-
373
- if "tooltip" not in st.session_state:
374
- st.session_state.tooltip = 'The AI answer your questions only considering the documents provided'
375
 
376
  client, collection_name, template, model, llm, dense_model, sparse_model = load_models_and_documents()
377
 
@@ -482,6 +468,14 @@ if __name__ == '__main__':
482
 
483
  with st.sidebar:
484
  st.divider()
 
 
 
 
 
 
 
 
485
  tooltip = 'The AI answer your questions only considering the documents provided'
486
 
487
  st.toggle(
 
358
  )
359
  st.title('Multipurpose AI Agent')
360
  #st.markdown("<h1 style='position: fixed; top: 0; left: 0; width: 100%; padding: 10px; text-align: left; color: black;'>Multipurpose AI Agent</h1>", unsafe_allow_html=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
361
 
362
  client, collection_name, template, model, llm, dense_model, sparse_model = load_models_and_documents()
363
 
 
468
 
469
  with st.sidebar:
470
  st.divider()
471
+
472
+ if 'documents_only' not in st.session_state:
473
+ st.session_state.documents_only = True
474
+ on_change_documents_only()
475
+
476
+ if "tooltip" not in st.session_state:
477
+ st.session_state.tooltip = 'The AI answer your questions only considering the documents provided'
478
+
479
  tooltip = 'The AI answer your questions only considering the documents provided'
480
 
481
  st.toggle(