Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -66,15 +66,36 @@ def chatbot(query: str) -> str:
|
|
| 66 |
except Exception as e:
|
| 67 |
return str(e)
|
| 68 |
|
| 69 |
-
# Create a Gradio GUI interface
|
| 70 |
-
inputs = gr.Textbox(lines=7, label=chatbot_input_label, placeholder=chatbot_input_placeholder)
|
| 71 |
-
outputs = gr.Markdown(label=chatbot_output_label)#, placeholder=chatbot_output_placeholder)
|
| 72 |
-
iface = gr.Interface(fn=chatbot,
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
|
|
|
|
|
|
|
|
|
|
| 78 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
if __name__ == "__main__":
|
| 80 |
iface.launch()
|
|
|
|
| 66 |
except Exception as e:
|
| 67 |
return str(e)
|
| 68 |
|
| 69 |
+
# # Create a Gradio GUI interface
|
| 70 |
+
# inputs = gr.Textbox(lines=7, label=chatbot_input_label, placeholder=chatbot_input_placeholder)
|
| 71 |
+
# outputs = gr.Markdown(label=chatbot_output_label)#, placeholder=chatbot_output_placeholder)
|
| 72 |
+
# iface = gr.Interface(fn=chatbot,
|
| 73 |
+
# inputs=inputs,
|
| 74 |
+
# outputs=outputs,
|
| 75 |
+
# title=title,
|
| 76 |
+
# description=description)
|
| 77 |
|
| 78 |
+
# Create a Gradio Blocks interface
|
| 79 |
+
with gr.Blocks() as demo:
|
| 80 |
+
gr.Markdown("# AI Chatbot Interface")
|
| 81 |
|
| 82 |
+
with gr.Row():
|
| 83 |
+
user_input = gr.Textbox(
|
| 84 |
+
lines=7,
|
| 85 |
+
label=chatbot_input_label,
|
| 86 |
+
placeholder=chatbot_input_placeholder
|
| 87 |
+
)
|
| 88 |
+
|
| 89 |
+
with gr.Row():
|
| 90 |
+
output = gr.Markdown(
|
| 91 |
+
label=chatbot_output_label
|
| 92 |
+
)
|
| 93 |
+
|
| 94 |
+
with gr.Row():
|
| 95 |
+
submit = gr.Button("Submit")
|
| 96 |
+
|
| 97 |
+
# Define button click action
|
| 98 |
+
submit.click(fn=chatbot, inputs=user_input, outputs=output)
|
| 99 |
+
|
| 100 |
if __name__ == "__main__":
|
| 101 |
iface.launch()
|