ECUiVADE commited on
Commit
65ba366
1 Parent(s): a0cdca3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -12
app.py CHANGED
@@ -191,9 +191,9 @@ def generate(prompt, history):
191
  yield output
192
 
193
 
194
- def name_interface(name,occupation,ethnicity,gender,age):
195
  global Name, Occupation,Ethnicity,Gender,Age,chat_log_name
196
-
197
  Name = name
198
  Occupation = occupation
199
  Ethnicity=ethnicity
@@ -235,19 +235,15 @@ chat_bot=gr.ChatInterface(
235
  )
236
 
237
  reset_interface = gr.Interface(
238
- fn=lambda x: x, # Placeholder function, actual reset is handled by button actions
239
- inputs=[gr.Button(choices=["Reset Chat", "Reset User Info", "Reset All"], label="Select what to reset")],
 
 
240
  outputs="text",
241
  title="Reset Controls",
242
- description="Use the buttons below to reset chat, user information, or both."
243
  )
244
 
245
- reset_interface.update(
246
- fn=dict(
247
- Reset_Chat=reset_chat_interface,
248
- Reset_User_Info=reset_name_interface,
249
- Reset_All=reset_all
250
- )
251
  )
252
  name_interface = gr.Interface(
253
  fn=name_interface,
@@ -256,7 +252,8 @@ name_interface = gr.Interface(
256
  gr.Textbox(label="Occupation", placeholder="Enter your occupation here..."),
257
  gr.Textbox(label="Ethnicity", placeholder="Enter your Ethnicity here..."),
258
  gr.Dropdown(choices=["Male", "Female", "Other"], label="Gender"),
259
- gr.Textbox(label="Age", placeholder="Enter your Age here...")
 
260
  ],outputs="text",
261
  title="ECU-IVADE : User Information",
262
  description="Please enter your name and occupation."
 
191
  yield output
192
 
193
 
194
+ def name_interface(name,occupation,ethnicity,gender,age,reset_button):
195
  global Name, Occupation,Ethnicity,Gender,Age,chat_log_name
196
+ print(reset_button)
197
  Name = name
198
  Occupation = occupation
199
  Ethnicity=ethnicity
 
235
  )
236
 
237
  reset_interface = gr.Interface(
238
+ fn=reset_all, # Placeholder function, actual reset is handled by button actions
239
+ inputs=[
240
+ gr.Button("Reset All", elem_id="button1"),
241
+ ],
242
  outputs="text",
243
  title="Reset Controls",
244
+ description="Use the button below to reset "
245
  )
246
 
 
 
 
 
 
 
247
  )
248
  name_interface = gr.Interface(
249
  fn=name_interface,
 
252
  gr.Textbox(label="Occupation", placeholder="Enter your occupation here..."),
253
  gr.Textbox(label="Ethnicity", placeholder="Enter your Ethnicity here..."),
254
  gr.Dropdown(choices=["Male", "Female", "Other"], label="Gender"),
255
+ gr.Textbox(label="Age", placeholder="Enter your Age here..."),
256
+ gr.Button("Reset All", elem_id="reset_button")
257
  ],outputs="text",
258
  title="ECU-IVADE : User Information",
259
  description="Please enter your name and occupation."