gradio icon indicating copy to clipboard operation
gradio copied to clipboard

Text color of gr.Examples is invisible with gr.themes.Monochrome

Open Jason-cs18 opened this issue 1 year ago • 3 comments

  • [x] I have searched to see if a similar issue already exists. I want to show examples within gr.themes.Monochrome(). I have checked out the theme document, but I cannot find any helpful information.
with gr.Blocks(title="Audio Generation", theme=gr.themes.Monochrome()) as demo:
    gr.Markdown(description_tts)
    input = gr.Textbox(label="需要转换的文本", value="最近很辛苦,五一我要出去找个地方散散心!")
    voice_style = gr.Dropdown(["男声1-台湾话", "男声2-香港话", "男声3-普通话", "男声4-普通话", "男声5-普通话", "男声6-普通话", "女声1-普通话", "女声2-普通话", "女声3-辽宁话", "女声4-山西话", "女声5-香港话", "女声6-香港话", "女声7-台湾话", "女声8-台湾话"], label="默认角色", value="女声7-台湾话")
    # custom_audio = gr.Audio(label="自定义声音", type='filepath')
    output = gr.Audio(label="合成的语音")
    submit_button = gr.Button("提交")
    # clear_button = gr.ClearButton("清空"),
    submit_button.click(
        fn=audio_generation,
        inputs=[input, voice_style],
        outputs=output
    )
    gr.Examples(
        examples=audio_examples,
        inputs=[input, voice_style],
        label="案例",
    )

image

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Additional context
Add any other context or screenshots about the feature request here.

Jason-cs18 avatar May 21 '24 13:05 Jason-cs18

@abidlabs

Jason-cs18 avatar May 21 '24 13:05 Jason-cs18

Hi @Jason-cs18 you could probably use custom CSS for this, but the real problem is that example font shows up invisibly in this theme, which we should fix. I'll rename the issue, and here is a standalone repro for our team, we'll take a look at it as soon as we can!

import gradio as gr

with gr.Blocks(title="Audio Generation", theme=gr.themes.Monochrome()) as demo:
    input = gr.Textbox(label="需要转换的文本", value="最近很辛苦,五一我要出去找个地方散散心!")
    voice_style = gr.Dropdown(["男声1-台湾话", "男声2-香港话", "男声3-普通话", "男声4-普通话", "男声5-普通话", "男声6-普通话", "女声1-普通话", "女声2-普通话", "女声3-辽宁话", "女声4-山西话", "女声5-香港话", "女声6-香港话", "女声7-台湾话", "女声8-台湾话"], label="默认角色", value="女声7-台湾话")
    output = gr.Audio(label="合成的语音")
    submit_button = gr.Button("提交")
    gr.Examples(
        examples=[["cantina.wav", "abc"]],
        inputs=[input, voice_style],
        label="案例",
    )
    
demo.launch()

abidlabs avatar May 21 '24 22:05 abidlabs

cc @hannahblair as you just fixed a very similar bug

abidlabs avatar May 21 '24 22:05 abidlabs