Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
68 |
if input_type == "Image":
|
69 |
-
|
70 |
-
text_input.visible = False
|
71 |
elif input_type == "Text":
|
72 |
-
|
73 |
-
image_input.visible = False
|
74 |
elif input_type == "Both":
|
75 |
-
|
76 |
-
|
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 |
|