Tesneem commited on
Commit
36e960e
1 Parent(s): 98ee328

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -8
app.py CHANGED
@@ -64,17 +64,14 @@ with gr.Blocks() as demo:
64
  text_input = gr.Textbox(label="Enter Text Query", placeholder="Enter a description or query here", visible=False) # Hidden initially
65
 
66
  # Based on the selected input type, make the appropriate input visible
67
- def update_inputs(input_type):
68
  if input_type == "Image":
69
- image_input.visible = True
70
- text_input.visible = False
71
  elif input_type == "Text":
72
- text_input.visible = True
73
- image_input.visible = False
74
  elif input_type == "Both":
75
- image_input.visible = True
76
- text_input.visible = True
77
- return image_input, text_input
78
 
79
  input_type.change(fn=update_inputs, inputs=input_type, outputs=[image_input, text_input])
80
 
 
64
  text_input = gr.Textbox(label="Enter Text Query", placeholder="Enter a description or query here", visible=False) # Hidden initially
65
 
66
  # Based on the selected input type, make the appropriate input visible
67
+ def update_inputs(input_type):
68
  if input_type == "Image":
69
+ return gr.update(visible=True), gr.update(visible=False)
 
70
  elif input_type == "Text":
71
+ return gr.update(visible=False), gr.update(visible=True)
 
72
  elif input_type == "Both":
73
+ return gr.update(visible=True), gr.update(visible=True)
74
+
 
75
 
76
  input_type.change(fn=update_inputs, inputs=input_type, outputs=[image_input, text_input])
77