Spaces:
Sleeping
Sleeping
Commit
·
17b63bb
1
Parent(s):
3fd4883
added example prompt
Browse files- Gradio_UI.py +14 -0
Gradio_UI.py
CHANGED
|
@@ -289,6 +289,20 @@ class GradioUI:
|
|
| 289 |
[text_input, file_uploads_log],
|
| 290 |
[stored_messages, text_input],
|
| 291 |
).then(self.interact_with_agent, [stored_messages, chatbot], [chatbot])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 292 |
|
| 293 |
demo.launch(debug=True, share=True, **kwargs)
|
| 294 |
|
|
|
|
| 289 |
[text_input, file_uploads_log],
|
| 290 |
[stored_messages, text_input],
|
| 291 |
).then(self.interact_with_agent, [stored_messages, chatbot], [chatbot])
|
| 292 |
+
|
| 293 |
+
def chat_function(input_text):
|
| 294 |
+
return f"You said: {input_text}"
|
| 295 |
+
|
| 296 |
+
# Pre-written input text
|
| 297 |
+
pre_written_text = "I am a female with 45 kgs, 150 cms tall and 22 years of age. Calculate my BMR."
|
| 298 |
+
|
| 299 |
+
# Creating a Gradio chat box with example prompt
|
| 300 |
+
chat_interface = gr.Interface(
|
| 301 |
+
fn=chat_function,
|
| 302 |
+
inputs=gr.Textbox(value=pre_written_text, lines=3, label="This tool calculates the Basal Metabolism Rate (BMR). Example Prompt: ", interactive=False),
|
| 303 |
+
outputs=None,
|
| 304 |
+
live=True
|
| 305 |
+
)
|
| 306 |
|
| 307 |
demo.launch(debug=True, share=True, **kwargs)
|
| 308 |
|