Update app.py
Browse files
app.py
CHANGED
@@ -89,7 +89,7 @@ def chat(user_input, messages):
|
|
89 |
|
90 |
# Gradio Interface
|
91 |
with gr.Blocks() as demo:
|
92 |
-
gr.Markdown("##
|
93 |
|
94 |
# Sidebar for user inputs
|
95 |
with gr.Row():
|
@@ -131,20 +131,30 @@ with gr.Blocks() as demo:
|
|
131 |
]
|
132 |
|
133 |
# Create a separate button for the questionnaire
|
134 |
-
fill_questionnaire_btn = gr.Button("Fill Questionnaire")
|
135 |
|
|
|
|
|
136 |
for question, choices in fashion_questions:
|
137 |
-
gr.Radio(label=question, choices=choices)
|
138 |
|
139 |
# Chat functionality
|
140 |
chatbox = gr.Chatbot(type='messages')
|
141 |
user_input = gr.Textbox(label="Your Message", placeholder="Type your message here...")
|
142 |
|
143 |
# Connect the buttons to their respective functions
|
144 |
-
submit_btn.click(
|
145 |
-
|
|
|
|
|
|
|
|
|
146 |
|
147 |
-
fill_questionnaire_btn.click(
|
|
|
|
|
|
|
|
|
148 |
|
149 |
# Corrected reset button output
|
150 |
reset_btn.click(reset_chat, outputs=[chatbox, "title"])
|
|
|
89 |
|
90 |
# Gradio Interface
|
91 |
with gr.Blocks() as demo:
|
92 |
+
gr.Markdown("## FRIDAY")
|
93 |
|
94 |
# Sidebar for user inputs
|
95 |
with gr.Row():
|
|
|
131 |
]
|
132 |
|
133 |
# Create a separate button for the questionnaire
|
134 |
+
fill_questionnaire_btn = gr.Button("Fill Additional Questionnaire")
|
135 |
|
136 |
+
# Adding additional questions
|
137 |
+
additional_responses = []
|
138 |
for question, choices in fashion_questions:
|
139 |
+
additional_responses.append(gr.Radio(label=question, choices=choices))
|
140 |
|
141 |
# Chat functionality
|
142 |
chatbox = gr.Chatbot(type='messages')
|
143 |
user_input = gr.Textbox(label="Your Message", placeholder="Type your message here...")
|
144 |
|
145 |
# Connect the buttons to their respective functions
|
146 |
+
submit_btn.click(
|
147 |
+
submit_questionnaire,
|
148 |
+
inputs=[name, age, location, gender, ethnicity, height, weight,
|
149 |
+
style_preference, color_palette, everyday_style],
|
150 |
+
outputs=gr.Textbox(label="Submission Response")
|
151 |
+
)
|
152 |
|
153 |
+
fill_questionnaire_btn.click(
|
154 |
+
collect_questionnaire_responses,
|
155 |
+
inputs=[style_preference, color_palette, everyday_style],
|
156 |
+
outputs=gr.Textbox(label="Additional Questions Response")
|
157 |
+
)
|
158 |
|
159 |
# Corrected reset button output
|
160 |
reset_btn.click(reset_chat, outputs=[chatbox, "title"])
|