Spaces:
Sleeping
Sleeping
File size: 424 Bytes
1db582e af7c474 a924ad2 af7c474 571bda5 50b6475 af7c474 1db582e af7c474 50b6475 737d007 3cb650b 438b1f7 50b6475 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
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() |