Upload main.py
Browse files
main.py
CHANGED
@@ -16,6 +16,7 @@ with gr.Blocks(theme="glass") as demo:
|
|
16 |
|
17 |
def respond(message, chat_history):
|
18 |
bot_message = generate_response(message, chat_history)
|
|
|
19 |
chat_history.append({"role": "user", "content": message})
|
20 |
chat_history.append({"role": "assistant", "content": bot_message})
|
21 |
return "", chat_history
|
@@ -23,12 +24,14 @@ with gr.Blocks(theme="glass") as demo:
|
|
23 |
msg.submit(respond, [msg, chatbot], [msg, chatbot])
|
24 |
|
25 |
gr.Examples([
|
|
|
26 |
["How should a MDPE pipe cross a Nallah?"],
|
27 |
["At what depth should a MDPE pipe be laid?"],
|
28 |
["Explain with example RFC shortfall calculation for vendor of Pool 1."],
|
29 |
], inputs=msg, label= "Examples"
|
30 |
)
|
31 |
|
|
|
32 |
gr.HTML(description)
|
33 |
|
34 |
|
|
|
16 |
|
17 |
def respond(message, chat_history):
|
18 |
bot_message = generate_response(message, chat_history)
|
19 |
+
bot_message = bot_message.replace("\\times", "*").replace("\\text{", "").replace("}", "")
|
20 |
chat_history.append({"role": "user", "content": message})
|
21 |
chat_history.append({"role": "assistant", "content": bot_message})
|
22 |
return "", chat_history
|
|
|
24 |
msg.submit(respond, [msg, chatbot], [msg, chatbot])
|
25 |
|
26 |
gr.Examples([
|
27 |
+
["How is penalty to be deducted from O&M bill of CNG 1200 SCMH compressor package against gas loss of 60,000 SCM in a month. Explain with detailed calculations."],
|
28 |
["How should a MDPE pipe cross a Nallah?"],
|
29 |
["At what depth should a MDPE pipe be laid?"],
|
30 |
["Explain with example RFC shortfall calculation for vendor of Pool 1."],
|
31 |
], inputs=msg, label= "Examples"
|
32 |
)
|
33 |
|
34 |
+
clear.click(lambda: None, None, chatbot, queue=False)
|
35 |
gr.HTML(description)
|
36 |
|
37 |
|