temp-cloud / app.py
13ze's picture
Create app.py
d4b8e75 verified
raw
history blame
No virus
507 Bytes
import gradio as gr
import os
from uuid import uuid4
def upload_file(file):
file_path = f"/tmp/{uuid4()}-{file.name}"
with open(file_path, "wb") as f:
f.write(file.read())
download_url = f"https://huggingface.co/space-name/download?file={file_path}"
return download_url
iface = gr.Interface(
fn=upload_file,
inputs="file",
outputs="text",
title="File Upload and Download URL Generator",
description="Upload a file and get a downloadable URL."
)
iface.launch()