def generate_art(character_dropdown, seed_slider):
if character_dropdown == "NONE":
return "NULL"
else:
return "NOT NULL"
return "Hello There!"
HTML_TEMPLATE = """
"""
with gr.Blocks() as interface:
gr.HTML(value=HTML_TEMPLATE, show_label=False)
with gr.Row():
character_dropdown = gr.Dropdown(
label="Select a Character",
choices=["NONE","ROMEO","OPHELIA","DESDEMONA","MACDUFF"],
value='Dream'
)
seed_slider = gr.Slider(
label="Random Seed",
minimum=0,
maximum=1000,
step=1,
value=42
)
inputs = [character_dropdown, seed_slider]
with gr.Row():
outputs = gr.Textbox(
label="Generated Dialogue"
)
with gr.Row():
button = gr.Button("Generate Dialogue")
button.click(generate_art, inputs=inputs, outputs=outputs)
if __name__ == "__main__":
interface.launch(enable_queue=True)