Space
UI Spaces Echo
ui-spaces/ui-spaces-echo
Add echo app
ui-spaces committed on October 21, 2026
9c4ccf3ab1293f8f057f1add491238d713afd25cParent 43f566aBrowse files
1 file changed+13 -0
app.py
Added+13 -0
app.py
Added+13 -0
| @@ -0,0 +1,13 @@ | |||
| 1 | Added: import gradio as gr | ||
| 2 | Added: import humanize | ||
| 3 | Added: | ||
| 4 | Added: | ||
| 5 | Added: def echo(text): | ||
| 6 | Added: n = len(text or "") | ||
| 7 | Added: return f"{text} ({n} characters, {humanize.apnumber(n)})" | ||
| 8 | Added: | ||
| 9 | Added: | ||
| 10 | Added: demo = gr.Interface(fn=echo, inputs=gr.Textbox(label="Text"), outputs=gr.Textbox(label="Echo"), title="UI Spaces Echo") | ||
| 11 | Added: | ||
| 12 | Added: if __name__ == "__main__": | ||
| 13 | Added: demo.launch() | ||