Spaces:
Running on Zero
Running on Zero
Jahmori commited on
Commit ·
16401da
1
Parent(s): 7ca42a4
using sync_buckets for directory
Browse files
app.py
CHANGED
|
@@ -12,6 +12,8 @@ from speechbrain.utils.fetching import FetchConfig
|
|
| 12 |
from pyannote.audio import Pipeline
|
| 13 |
from pyannote.core import Segment, Annotation
|
| 14 |
from transformers import pipeline, AutoModelForSpeechSeq2Seq, AutoProcessor
|
|
|
|
|
|
|
| 15 |
|
| 16 |
# Process Outline
|
| 17 |
# 1. Initialize ReSepformer model
|
|
@@ -34,7 +36,7 @@ torch.backends.cudnn.allow_tf32 = False
|
|
| 34 |
|
| 35 |
|
| 36 |
token = os.environ.get("HF_TOKEN")
|
| 37 |
-
model_path = "/home/user/app/pretrained_models/resepformer-librimix2spk"
|
| 38 |
temp_dir = tempfile.gettempdir()
|
| 39 |
|
| 40 |
|
|
@@ -51,6 +53,7 @@ def process_audio(mixture):
|
|
| 51 |
Path.mkdir(sources,exist_ok=True)
|
| 52 |
|
| 53 |
|
|
|
|
| 54 |
|
| 55 |
# ---------------------------------------------------------
|
| 56 |
# INITIALIZE MODELS
|
|
|
|
| 12 |
from pyannote.audio import Pipeline
|
| 13 |
from pyannote.core import Segment, Annotation
|
| 14 |
from transformers import pipeline, AutoModelForSpeechSeq2Seq, AutoProcessor
|
| 15 |
+
from huggingface_hub import sync_bucket
|
| 16 |
+
|
| 17 |
|
| 18 |
# Process Outline
|
| 19 |
# 1. Initialize ReSepformer model
|
|
|
|
| 36 |
|
| 37 |
|
| 38 |
token = os.environ.get("HF_TOKEN")
|
| 39 |
+
# model_path = "/home/user/app/pretrained_models/resepformer-librimix2spk"
|
| 40 |
temp_dir = tempfile.gettempdir()
|
| 41 |
|
| 42 |
|
|
|
|
| 53 |
Path.mkdir(sources,exist_ok=True)
|
| 54 |
|
| 55 |
|
| 56 |
+
model_path = sync_bucket("hf://buckets/Jahmori-R/PureVoiceAISpace-storage/data", "./data")
|
| 57 |
|
| 58 |
# ---------------------------------------------------------
|
| 59 |
# INITIALIZE MODELS
|