Space

UI Spaces Echo

ui-spaces/ui-spaces-echo-copy

Fix the crash

ui-spaces committed on October 21, 2026

5633e0fd19d75bc5f7c0b06d486081130f02d5abParent 648ab50Browse files

1 file changed+13 -4

app.py

Modified+13 -4
Lines 1 to 4 become lines 1 to 13
@@ -1,4 +1,13 @@
1Removed: import sys
2Removed: print("ui-spaces crash test: starting up", flush=True)
3Removed: print("ui-spaces crash test: about to fail on purpose", file=sys.stderr, flush=True)
4Removed: raise RuntimeError("ui-spaces deliberate crash for the runtime error test")
1Added: import gradio as gr
2Added: import humanize
3Added:
4Added:
5Added: def echo(text):
6Added: n = len(text or "")
7Added: return f"{text} ({n} characters, {humanize.apnumber(n)})"
8Added:
9Added:
10Added: demo = gr.Interface(fn=echo, inputs=gr.Textbox(label="Text"), outputs=gr.Textbox(label="Echo"), title="UI Spaces Echo")
11Added:
12Added: if __name__ == "__main__":
13Added: demo.launch()