Spaces:
Sleeping
Sleeping
File size: 425 Bytes
1db582e af7c474 1db582e af7c474 1db582e af7c474 7821c9a af7c474 1db582e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
import gradio as gr
from uuid import uuid4
from fileManager import FileManager
import re
fileManager = FileManager()
fileManager.start()
def saveFile(file):
with open(file.name, "rb") as rfile:
file_infor = fileManager.saveFile(rfile.read(), file.orig_name)
return f"https://astraos-nx-storage.hf.space/file=./{file_infor['path']}"
nxapp = gr.Interface(fn=saveFile, inputs="file", outputs="text")
nxapp.launch()
|