Spaces:
Starting
on
T4
Starting
on
T4
Update app.py
Browse files
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"""
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|