Spaces:
Sleeping
Sleeping
Update chat.py
Browse files
chat.py
CHANGED
|
@@ -33,7 +33,7 @@ DO NOT mention anything about the context in your final answer.
|
|
| 33 |
Your response should only contain the answer to the question AND NOTHING ELSE.
|
| 34 |
DO NOT answer any questions about customers whose details are different from those mentioned in ###Customer Information.
|
| 35 |
|
| 36 |
-
If the answer is not found in the context or in the customer information, respond "Sorry, I cannot answer your
|
| 37 |
"""
|
| 38 |
|
| 39 |
qna_user_message_template = """
|
|
@@ -110,7 +110,7 @@ def make_completion(input:str, history: List[Message]) -> Optional[str]:
|
|
| 110 |
|
| 111 |
prediction = response.choices[0].message.content.strip()
|
| 112 |
except Exception as e:
|
| 113 |
-
prediction = f'Sorry, please contact our hotline: 1-800-
|
| 114 |
|
| 115 |
return prediction
|
| 116 |
|
|
@@ -138,7 +138,7 @@ with gr.Blocks() as demo:
|
|
| 138 |
chatbot = gr.Chatbot(label="CHAT", layout="bubble", likeable=True, show_copy_button=True)
|
| 139 |
state = gr.State([])
|
| 140 |
with gr.Row():
|
| 141 |
-
txt = gr.Textbox(show_label=True, placeholder="Enter
|
| 142 |
txt.submit(predict, [txt, state], [chatbot, state])
|
| 143 |
|
| 144 |
demo.launch(auth=("demouser", os.getenv('PASSWD')))
|
|
|
|
| 33 |
Your response should only contain the answer to the question AND NOTHING ELSE.
|
| 34 |
DO NOT answer any questions about customers whose details are different from those mentioned in ###Customer Information.
|
| 35 |
|
| 36 |
+
If the answer is not found in the context or in the customer information, respond "Sorry, I cannot answer your query at this point, please contact our hotline: 1-800-INSURANCE".
|
| 37 |
"""
|
| 38 |
|
| 39 |
qna_user_message_template = """
|
|
|
|
| 110 |
|
| 111 |
prediction = response.choices[0].message.content.strip()
|
| 112 |
except Exception as e:
|
| 113 |
+
prediction = f'Sorry, I cannot answer your query at this point, please contact our hotline: 1-800-INSURANCE'
|
| 114 |
|
| 115 |
return prediction
|
| 116 |
|
|
|
|
| 138 |
chatbot = gr.Chatbot(label="CHAT", layout="bubble", likeable=True, show_copy_button=True)
|
| 139 |
state = gr.State([])
|
| 140 |
with gr.Row():
|
| 141 |
+
txt = gr.Textbox(show_label=True, placeholder="Enter your query and press enter")
|
| 142 |
txt.submit(predict, [txt, state], [chatbot, state])
|
| 143 |
|
| 144 |
demo.launch(auth=("demouser", os.getenv('PASSWD')))
|