Update main.py
Browse files
main.py
CHANGED
|
@@ -60,6 +60,7 @@ def gradinterface(query,history):
|
|
| 60 |
Use three sentences maximum and keep the answer as concise as possible.
|
| 61 |
{context}
|
| 62 |
Question: {question}
|
|
|
|
| 63 |
Helpful Answer:"""
|
| 64 |
|
| 65 |
QA_CHAIN_PROMPT = PromptTemplate(
|
|
@@ -72,7 +73,7 @@ def gradinterface(query,history):
|
|
| 72 |
chain_type_kwargs={"prompt": QA_CHAIN_PROMPT},
|
| 73 |
)
|
| 74 |
result = qa_chain({"query": query})
|
| 75 |
-
return result['result']
|
| 76 |
|
| 77 |
|
| 78 |
demo = gr.ChatInterface(fn=gradinterface, title='OUR_OWN_BOT')
|
|
|
|
| 60 |
Use three sentences maximum and keep the answer as concise as possible.
|
| 61 |
{context}
|
| 62 |
Question: {question}
|
| 63 |
+
|
| 64 |
Helpful Answer:"""
|
| 65 |
|
| 66 |
QA_CHAIN_PROMPT = PromptTemplate(
|
|
|
|
| 73 |
chain_type_kwargs={"prompt": QA_CHAIN_PROMPT},
|
| 74 |
)
|
| 75 |
result = qa_chain({"query": query})
|
| 76 |
+
return result['result'].split(': ')[-1].strip()
|
| 77 |
|
| 78 |
|
| 79 |
demo = gr.ChatInterface(fn=gradinterface, title='OUR_OWN_BOT')
|