devve1 commited on
Commit
c65edc5
1 Parent(s): 8f7d1d5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -325,7 +325,13 @@ def chunk_documents(texts: List[str], metadatas: List[dict], dense_model: Optimu
325
 
326
  def on_change_documents_only():
327
  st.session_state.qa_prompt = lambda query, context: (
328
- f"""{context} {query} Don't give information outside the document or repeat your findings. Keep your response short and direct. If information not in the document, say 'no_answer'"""
 
 
 
 
 
 
329
  if st.session_state.documents_only else
330
  f"""If the context is not relevant, please answer the question by using your own knowledge about the topic.
331
  If you decide to provide information using your own knowledge or general knowledge, write 'knowledge_topic' at the top of your answer
 
325
 
326
  def on_change_documents_only():
327
  st.session_state.qa_prompt = lambda query, context: (
328
+ 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, just write 'no_answer'. Use three sentences maximum and keep the answer concise.
329
+
330
+ Question: {query}
331
+
332
+ Context: {context}
333
+
334
+ Answer:"""
335
  if st.session_state.documents_only else
336
  f"""If the context is not relevant, please answer the question by using your own knowledge about the topic.
337
  If you decide to provide information using your own knowledge or general knowledge, write 'knowledge_topic' at the top of your answer