Spaces:
Runtime error
Runtime error
import gradio as gr | |
def echo_text(input_text): | |
return input_text | |
# Custom HTML and CSS to display input above output | |
custom_interface = """ | |
<div style="text-align: center;"> | |
<label for="input-text">Input Text:</label><br> | |
<input type="text" id="input-text" name="input_text" value="Enter text here..." style="width: 80%;"><br> | |
<br> | |
<label for="output-text">Output Text:</label><br> | |
<textarea id="output-text" name="output_text" rows="5" cols="40" readonly style="width: 80%;"></textarea> | |
</div> | |
""" | |
iface = gr.Interface( | |
fn=echo_text, | |
inputs=gr.HTML(custom_interface), # Use custom HTML interface | |
outputs=gr.Textbox("Output will be displayed here.", type="output"), | |
live=True | |
) | |
iface.launch() | |