eienmojiki commited on
Commit
0b10d04
·
verified ·
1 Parent(s): 830609c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -33,9 +33,10 @@ def create_app():
33
  # Xử lý cập nhật UI
34
  def update_controls(filter_name):
35
  updates = []
36
- for key in controls:
37
- current_filter, _ = key.split('_', 1)
38
- updates.append(gr.update(visible=current_filter == filter_name))
 
39
  return updates
40
 
41
  # Xử lý ảnh real-time
 
33
  # Xử lý cập nhật UI
34
  def update_controls(filter_name):
35
  updates = []
36
+ for filter_name_ctrl, filter_ctrl_list in controls.items(): # Correctly unpack key-value pairs
37
+ visibility = filter_name_ctrl == filter_name
38
+ for component in filter_ctrl_list: # Iterate through the list of controls
39
+ updates.append(gr.update(visible=visibility)) # Update visibility for each control
40
  return updates
41
 
42
  # Xử lý ảnh real-time