Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -9,8 +9,6 @@ from huggingface_hub import hf_hub_download
|
|
9 |
fe_path = hf_hub_download("sarulab-speech/sidon-v0.1", filename="feature_extractor.pt")
|
10 |
decoder_path = hf_hub_download("sarulab-speech/sidon-v0.1", filename="decoder.pt")
|
11 |
|
12 |
-
fe = torch.jit.load(fe_path,map_location='cuda').to('cuda')
|
13 |
-
decoder = torch.jit.load(decoder_path,map_location='cuda').to('cuda')
|
14 |
preprocessor = transformers.SeamlessM4TFeatureExtractor.from_pretrained(
|
15 |
"facebook/w2v-bert-2.0"
|
16 |
)
|
@@ -18,6 +16,9 @@ preprocessor = transformers.SeamlessM4TFeatureExtractor.from_pretrained(
|
|
18 |
|
19 |
@spaces.GPU
|
20 |
def denoise_speech(audio):
|
|
|
|
|
|
|
21 |
if audio is None:
|
22 |
return None
|
23 |
|
|
|
9 |
fe_path = hf_hub_download("sarulab-speech/sidon-v0.1", filename="feature_extractor.pt")
|
10 |
decoder_path = hf_hub_download("sarulab-speech/sidon-v0.1", filename="decoder.pt")
|
11 |
|
|
|
|
|
12 |
preprocessor = transformers.SeamlessM4TFeatureExtractor.from_pretrained(
|
13 |
"facebook/w2v-bert-2.0"
|
14 |
)
|
|
|
16 |
|
17 |
@spaces.GPU
|
18 |
def denoise_speech(audio):
|
19 |
+
fe = torch.jit.load(fe_path,map_location='cuda').to('cuda')
|
20 |
+
decoder = torch.jit.load(decoder_path,map_location='cuda').to('cuda')
|
21 |
+
|
22 |
if audio is None:
|
23 |
return None
|
24 |
|