Space

wdtest-a/ptest-storage

Upload app.py with huggingface_hub

wdtest-a committed on October 19, 2026

ddf13eb2229710fa33930f21edae50c8d6e0faa3Parent 14da5c7Browse files

1 file changed+4 -3

app.py

Modified+4 -3
Lines 1 to 5 become lines 1 to 6
@@ -1,5 +1,6 @@
11import gradio as gr, os
2Removed: os.makedirs("/data", exist_ok=True)
3Removed: with open("/data/x","a") as f: f.write("boot\n")
4Removed: def r(_): return open("/data/x").read() + "|ls=" + ",".join(os.listdir("/data")) + "|HF_HOME=" + os.environ.get("HF_HOME","")
2Added: d="/data"; ok=os.access(d, os.W_OK)
3Added: if ok:
4Added: with open("/data/x","a") as f: f.write("boot\n")
5Added: def r(_): return ("data_writable=%s|"%ok) + (open("/data/x").read() if ok else "")
56gr.Interface(r, "text", "text", api_name="predict").launch(server_name="0.0.0.0")