Update app.py
Browse files
app.py
CHANGED
|
@@ -12,20 +12,18 @@ def get_response(user_input):
|
|
| 12 |
# Check if the request was successful
|
| 13 |
if response.status_code == 200:
|
| 14 |
answer = response.text # API response is already a string
|
| 15 |
-
return
|
| 16 |
else:
|
| 17 |
-
return "
|
| 18 |
-
|
| 19 |
|
| 20 |
# Create the Gradio interface
|
| 21 |
iface = gr.Interface(
|
| 22 |
fn=get_response, # Function to call when user submits input
|
| 23 |
inputs="text", # Input type
|
| 24 |
outputs="text", # Output type
|
| 25 |
-
title="
|
| 26 |
-
description="
|
| 27 |
-
theme="default", # Use the default theme
|
| 28 |
)
|
| 29 |
|
| 30 |
-
# Launch the Gradio app
|
| 31 |
-
iface.launch(server_name="0.0.0.0", server_port=8709, share=True)
|
|
|
|
| 12 |
# Check if the request was successful
|
| 13 |
if response.status_code == 200:
|
| 14 |
answer = response.text # API response is already a string
|
| 15 |
+
return answer
|
| 16 |
else:
|
| 17 |
+
return "Sorry, there was an error with your request."
|
|
|
|
| 18 |
|
| 19 |
# Create the Gradio interface
|
| 20 |
iface = gr.Interface(
|
| 21 |
fn=get_response, # Function to call when user submits input
|
| 22 |
inputs="text", # Input type
|
| 23 |
outputs="text", # Output type
|
| 24 |
+
title="Temple Dekho Chat Bot",
|
| 25 |
+
description="Ask a question about temples or rituals and get answers from the Guru!"
|
|
|
|
| 26 |
)
|
| 27 |
|
| 28 |
+
# Launch the Gradio app
|
| 29 |
+
iface.launch(server_name="0.0.0.0", server_port=8709, share=True)
|