Spaces:
Sleeping
Sleeping
Download api/firebase_storage.py from teraverse/Dr.Yasuda_streamlit: direct link, hf CLI and curl.
- Browser
- Download file 303 Bytes
-
https://huggingface.co/spaces/teraverse/Dr.Yasuda_streamlit/resolve/main/api/firebase_storage.py
- Command line
-
hf download hf://spaces/teraverse/Dr.Yasuda_streamlit/api/firebase_storage.py
-
curl -L -o firebase_storage.py https://huggingface.co/spaces/teraverse/Dr.Yasuda_streamlit/resolve/main/api/firebase_storage.py
303 Bytes
| from pathlib import Path | |
| import uuid | |
| from firebase_admin import storage | |
| def upload_audio_to_firebase(audio_path: Path): | |
| bucket = storage.bucket() | |
| blob = bucket.blob(f"audio/{uuid.uuid4().hex}.mp3") | |
| blob.upload_from_filename(str(audio_path)) | |
| blob.make_public() | |
| return blob.public_url |