Spaces:
Running
Running
cocktailpeanut
commited on
Commit
•
f2cbc32
1
Parent(s):
6ec52a1
update
Browse files- app.py +5 -2
- requirements.txt +4 -2
app.py
CHANGED
@@ -19,10 +19,13 @@ from models.tts.maskgct.g2p.g2p_generation import g2p, chn_eng_g2p
|
|
19 |
|
20 |
from transformers import SeamlessM4TFeatureExtractor
|
21 |
import py3langid as langid
|
|
|
22 |
|
23 |
|
24 |
processor = SeamlessM4TFeatureExtractor.from_pretrained("facebook/w2v-bert-2.0")
|
25 |
-
|
|
|
|
|
26 |
whisper_model = None
|
27 |
output_file_name_idx = 0
|
28 |
|
@@ -356,7 +359,7 @@ def maskgct_inference(
|
|
356 |
return recovered_audio
|
357 |
|
358 |
|
359 |
-
|
360 |
def inference(
|
361 |
prompt_wav,
|
362 |
target_text,
|
|
|
19 |
|
20 |
from transformers import SeamlessM4TFeatureExtractor
|
21 |
import py3langid as langid
|
22 |
+
import devicetorch
|
23 |
|
24 |
|
25 |
processor = SeamlessM4TFeatureExtractor.from_pretrained("facebook/w2v-bert-2.0")
|
26 |
+
DEVICE_NAME = devicetorch.get(torch)
|
27 |
+
device = torch.device(DEVICE_NAME)
|
28 |
+
#device = torch.device("cuda" if torch.cuda.is_available() else "CPU")
|
29 |
whisper_model = None
|
30 |
output_file_name_idx = 0
|
31 |
|
|
|
359 |
return recovered_audio
|
360 |
|
361 |
|
362 |
+
#@spaces.GPU
|
363 |
def inference(
|
364 |
prompt_wav,
|
365 |
target_text,
|
requirements.txt
CHANGED
@@ -5,7 +5,7 @@ ruamel.yaml
|
|
5 |
tqdm
|
6 |
tensorboard
|
7 |
tensorboardX
|
8 |
-
torch==2.0.1
|
9 |
transformers===4.41.1
|
10 |
encodec
|
11 |
black==24.1.1
|
@@ -30,4 +30,6 @@ LangSegment
|
|
30 |
onnxruntime
|
31 |
pyopenjtalk
|
32 |
pykakasi
|
33 |
-
openai-whisper
|
|
|
|
|
|
5 |
tqdm
|
6 |
tensorboard
|
7 |
tensorboardX
|
8 |
+
#torch==2.0.1
|
9 |
transformers===4.41.1
|
10 |
encodec
|
11 |
black==24.1.1
|
|
|
30 |
onnxruntime
|
31 |
pyopenjtalk
|
32 |
pykakasi
|
33 |
+
openai-whisper
|
34 |
+
devicetorch
|
35 |
+
gradio
|