Space
rv2-spaces/rv2-spaces-dup-other
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
app.py
Modified+4 -3
| @@ -1,5 +1,6 @@ | |||
| 1 | 1 | import gradio as gr, os | |
| 2 | Removed: os.makedirs("/data", exist_ok=True) | ||
| 3 | Removed: with open("/data/x","a") as f: f.write("boot\n") | ||
| 4 | Removed: def r(_): return open("/data/x").read() + "|ls=" + ",".join(os.listdir("/data")) + "|HF_HOME=" + os.environ.get("HF_HOME","") | ||
| 2 | Added: d="/data"; ok=os.access(d, os.W_OK) | ||
| 3 | Added: if ok: | ||
| 4 | Added: with open("/data/x","a") as f: f.write("boot\n") | ||
| 5 | Added: def r(_): return ("data_writable=%s|"%ok) + (open("/data/x").read() if ok else "") | ||
| 5 | 6 | gr.Interface(r, "text", "text", api_name="predict").launch(server_name="0.0.0.0") | |