Space
RV2 Humanize
rv2-spaces/rv2-spaces-gradio-copy
import os, gradio as gr, humanize, time
print("startup: GREETING=%r; secret set=%s" % (os.environ.get("GREETING"), bool(os.environ.get("RV2_SECRET"))), flush=True)
def f(n):
n=int(n)
return f"{humanize.intword(n)} / {humanize.naturalsize(n)} / {humanize.ordinal(n)}"
gr.Interface(fn=f, inputs=gr.Number(label="n"), outputs="text", title="RV2 Humanize").launch(prevent_thread_lock=True)
time.sleep(int(os.environ.get("CRASH_AFTER","100000")))
print("rv2: exiting on purpose", flush=True)
os._exit(3)