Spaces:
Sleeping
Sleeping
Download app.py from saifvj/stable-audio-api: direct link, hf CLI and curl.
- Browser
- Download file 406 Bytes
-
https://huggingface.co/spaces/saifvj/stable-audio-api/resolve/main/app.py
- Command line
-
hf download hf://spaces/saifvj/stable-audio-api/app.py
-
curl -L -o app.py https://huggingface.co/spaces/saifvj/stable-audio-api/resolve/main/app.py
406 Bytes
| from fastapi import FastAPI, UploadFile, File | |
| import os | |
| app = FastAPI() | |
| UPLOAD_DIR = "uploads" | |
| os.makedirs(UPLOAD_DIR, exist_ok=True) | |
| async def upload(file: UploadFile = File(...)): | |
| filepath = os.path.join(UPLOAD_DIR, file.filename) | |
| with open(filepath, "wb") as f: | |
| f.write(await file.read()) | |
| return { | |
| "success": True, | |
| "saved_to": filepath | |
| } |