Closed JohnHerry closed 10 months ago
Hi @JohnHerry I can't repro this issue. This is the code that I'm running:
import gradio as gr
colors = ['red', 'black', 'green']
def color_to_value(useless_arg, color):
values = {
'black': 0,
'green': 1,
'red': 2
}
return values[color]
demo = gr.Interface(
fn=color_to_value,
inputs=[
gr.Textbox(max_lines=10, label="this is useless, just ignore!"),
gr.Dropdown(
choices=colors,
multiselect=False,
allow_custom_value=False,
show_label=True,
label="Select a color")
],
outputs="number"
)
demo.launch()
Can you upgrade to the latest version of gradio
(4.8.0) and see if this issue is fixed?
It makes no difference when I upgrade to vertion 4.8,
let me show the whole code here:
def text_to_speech(input_text, speaker_name, speed):
....
return sr, audio
demo = gr.Interface(
fn=text_to_speech,
inputs=[
gr.Textbox(max_lines=10, placeholder="please input the text you want to hear", label="Input Text"),
gr.Dropdown(choices=list(speakers), value=0, multiselect=False, allow_custom_value=False, label="Speaker Name", info="please select a voice you want", show_label=True),
gr.Slider(0, 1, value=1.0, step=0.1, label="Speech Speed", info="You can adjust speech speed here")
],
outputs=gr.Audio(label="Result Waveform", show_download_button=True, autoplay=True),
title="TTS Demo APP"
)
if __name__ == "__main__":
demo.launch(show_error=True, server_name="0.0.0.0", server_port=8888)
All other components seems work except the Dropdown, its list page keeps showing even when I had make selection.
I added a slider, just as in your example, and it still is working fine for me.
Here's the code I've tested:
import gradio as gr
colors = ['red', 'black', 'green']
def color_to_value(useless_arg, color, ignore):
values = {
'black': 0,
'green': 1,
'red': 2
}
return values[color]
demo = gr.Interface(
fn=color_to_value,
inputs=[
gr.Textbox(max_lines=10, label="this is useless, just ignore!"),
gr.Dropdown(
choices=colors,
multiselect=False,
allow_custom_value=False,
show_label=True,
label="Select a color"),
gr.Slider()
],
outputs="number"
)
demo.launch()
and here's what I'm seeing:
https://github.com/gradio-app/gradio/assets/1778297/20043cf4-e23f-4d0d-bb23-cb213669227f
I'm running on Chrome, what about you?
I am using Chrome version of 90.0.4430.85 X64
Can you share a recording of what behavior you're seeing?
I am sorry it not clear in sight, but this shows the unexpected web action.
https://github.com/gradio-app/gradio/assets/8011802/c712f042-6f14-4802-b952-8d6dd3f1963c
What OS / environment are you running this on?
the gradio app is runing under conda env in a docker container of CentOS7.5 [python==3.11.4, gradio==4.8.0], the web is opened in Chrome in Windows10
Hi @JohnHerry we haven't been able to repro this issue on Colab, Windows, or Mac unfortunately. If you are able to check other environments to see if this problem persists for you, that'd be helpful. For now, I'll mark this as repro needed.
Closing for lack of reproducibility. Sorry! Let us know if you are able to find any other info that could help us repro this.
Describe the bug
I am using Gradio v4.5.0, I am using a Dropdown component. and the params are:
What I expect is if I select a color value, the Dropdown tab should close and leave what I had selected. But as a result, the Dropdown tab continues to pop out for me to do other selection, that is very strange.
Have you searched existing issues? 🔎
Reproduction
Screenshot
No response
Logs
No response
System Info
Severity
Blocking usage of gradio