Space
Humanize Demo
rv-spaces/rv-spaces-gradio
Add app
rv-spaces committed on October 20, 2026
46c440c248ca565a6f3ca64a7a4a41704d39cd84Parent 6e4c1aaBrowse files
1 file changed+10 -0
app.py
Added+10 -0
app.py
Added+10 -0
| @@ -0,0 +1,10 @@ | |||
| 1 | Added: import gradio as gr | ||
| 2 | Added: import humanize | ||
| 3 | Added: | ||
| 4 | Added: def describe(n): | ||
| 5 | Added: n = int(n or 0) | ||
| 6 | Added: return f"{humanize.intword(n)} / {humanize.naturalsize(n)} / {humanize.ordinal(n)}" | ||
| 7 | Added: | ||
| 8 | Added: demo = gr.Interface(describe, gr.Number(label="A number", value=1234567), gr.Textbox(label="Humanized"), | ||
| 9 | Added: title="rv-spaces humanize demo", api_name="predict") | ||
| 10 | Added: demo.launch() | ||