Space

wdtest-a/ptest-vol

519 BHistoryRawDownload
Viewing revision19a6a87View main files
import gradio as gr, os
def r(_):
    out=[]
    for root,ds,fs in os.walk("/mnt/m"):
        for f in fs: p=os.path.join(root,f); out.append(p+":"+str(os.path.getsize(p)))
    try: open("/mnt/m/new","w").write("x"); w="writable"
    except Exception as e: w="ro:"+type(e).__name__
    h=""
    try: h=open("/mnt/m/hello.txt").read().strip()
    except Exception as e: h="ERR "+type(e).__name__
    return "|".join(sorted(out))+"|"+w+"|"+h
gr.Interface(r,"text","text",api_name="predict").launch(server_name="0.0.0.0")