Space
Humanize Demo
rv-spaces/rv-spaces-gradio
import os
import gradio as gr
import humanize
def describe(n):
n = int(n or 0)
return f"{humanize.intword(n)} / {humanize.naturalsize(n)} / {humanize.ordinal(n)}"
info = f"GREETING={os.environ.get('GREETING')!r}; secret set={bool(os.environ.get('RV_SECRET'))}; secret len={len(os.environ.get('RV_SECRET',''))}"
print("startup:", info, flush=True)
demo = gr.Interface(describe, gr.Number(label="A number", value=1234567), gr.Textbox(label="Humanized"),
title="rv-spaces humanize demo", description=info, api_name="predict")
demo.launch()