Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,30 +1,20 @@
|
|
1 |
import gradio as gr
|
2 |
-
|
3 |
# Function to handle user feedback submission
|
4 |
-
def submit_feedback(message):
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
users[username] = password
|
23 |
-
return "Account created successfully!"
|
24 |
-
|
25 |
-
# Initialize user accounts and feedback list
|
26 |
-
users = {}
|
27 |
-
feedback = []
|
28 |
-
|
29 |
-
# Define the Gradio interface for user feedback submission
|
30 |
-
with gr.Blocks() as
|
|
|
1 |
import gradio as gr
|
|
|
2 |
# Function to handle user feedback submission
|
3 |
+
def submit_feedback(message):
|
4 |
+
# Store the message in a list (for simplicity, in a real app, this would be a database)
|
5 |
+
feedback_list.append(message)
|
6 |
+
return "Feedback submitted successfully!"
|
7 |
+
# Initialize a list to store feedback messages
|
8 |
+
feedback_list = []
|
9 |
+
# Create the Gradio interface
|
10 |
+
with gr.Blocks() as demo:
|
11 |
+
# Textbox for user input
|
12 |
+
message_input = gr.Textbox(label="Enter your feedback")
|
13 |
+
# Button to submit feedback
|
14 |
+
submit_button = gr.Button("Submit")
|
15 |
+
# Textbox to display the result
|
16 |
+
result_output = gr.Textbox(label="Result")
|
17 |
+
# Set up the event listener for the submit button
|
18 |
+
submit_button.click(fn=submit_feedback, inputs=message_input, outputs=result_output)
|
19 |
+
# Launch the Gradio app
|
20 |
+
demo.launch(show_error=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|