Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -73,42 +73,44 @@ def feedback_response(input_message, feedback, comments):
|
|
73 |
|
74 |
return initial_response, elapsed_time # Return the initial_response and elapsed_time
|
75 |
|
76 |
-
#
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
|
|
|
|
112 |
|
113 |
# Create a Blocks context for the buttons
|
114 |
with gr.Blocks() as buttons:
|
|
|
73 |
|
74 |
return initial_response, elapsed_time # Return the initial_response and elapsed_time
|
75 |
|
76 |
+
# Create a Blocks context for the interface
|
77 |
+
with gr.Blocks() as feedback_interface:
|
78 |
+
# Set up the Gradio Interface
|
79 |
+
gr.Interface(
|
80 |
+
fn=feedback_response,
|
81 |
+
inputs=[
|
82 |
+
gr.Textbox(label="Input Message"),
|
83 |
+
gr.Radio(
|
84 |
+
choices=[
|
85 |
+
"Informative",
|
86 |
+
"Inaccurate",
|
87 |
+
"Nonsense"
|
88 |
+
],
|
89 |
+
label="Feedback"),
|
90 |
+
gr.Textbox(label="Additional Comments")
|
91 |
+
],
|
92 |
+
outputs=[
|
93 |
+
gr.Textbox(label="Output", type="text"),
|
94 |
+
gr.Textbox(label="Elapsed Time (s)", type="text") # Change the type to "text" for two decimal places
|
95 |
+
],
|
96 |
+
title="Beta: Itell Guide Response Bot",
|
97 |
+
description="""
|
98 |
+
# Introduction
|
99 |
+
This is an interface to test iTELL's guide on the side. Please be aware that responses can take up to 20 seconds
|
100 |
+
|
101 |
+
# Step by Step Introduction
|
102 |
+
1. Place a question in the input message textbox
|
103 |
+
2. Wait roughly 10 ~ 20 seconds for the response and elapsed time to come out on the right
|
104 |
+
3. After looking at the results, select the feedback option that best describes the output: Informative, Inaccurate, Nonsense
|
105 |
+
4. After choosing the best option, write down additional comments for more feedback
|
106 |
+
5. Press submit again and wait for the output to come out again for your feedback to be submitted
|
107 |
+
6. Once the "Thank you for your feedback. Your response and feedback have been recorded!" message is shown, you are done
|
108 |
+
|
109 |
+
** DISCLAIMER: You have to type an input message, select a feedback option, and type in additional comments for your responses to be recorded
|
110 |
+
|
111 |
+
** For further questions contact LEAR Labs!
|
112 |
+
"""
|
113 |
+
)
|
114 |
|
115 |
# Create a Blocks context for the buttons
|
116 |
with gr.Blocks() as buttons:
|