redteaming-ui / test /dropdown.py
Jithin James
added tests folder
c512664
raw
history blame contribute delete
348 Bytes
import gradio as gr
def debug_click(drop_down):
print(drop_down)
return "yes"
with gr.Blocks() as demo:
drop_down = gr.Dropdown(
choices=["first", "second"], type="index", interactive=True, multiselect=False
)
txt = gr.Textbox()
btn = gr.Button("Clear")
btn.click(debug_click, inputs=drop_down, outputs=txt)