Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -9,6 +9,7 @@ from scipy.io import wavfile
|
|
9 |
model_ids = [
|
10 |
'suno/bark',
|
11 |
]
|
|
|
12 |
for model_id in model_ids:
|
13 |
model_name = model_id.split('/')[-1]
|
14 |
snapshot_download(model_id, local_dir=f'checkpoints/{model_name}')
|
@@ -18,7 +19,7 @@ from TTS.tts.models.bark import Bark
|
|
18 |
|
19 |
config = BarkConfig()
|
20 |
model = Bark.init_from_config(config)
|
21 |
-
model.load_checkpoint(config, checkpoint_dir="checkpoints/bark", eval=True)
|
22 |
|
23 |
def infer(prompt, input_wav_file):
|
24 |
|
@@ -116,6 +117,7 @@ def infer_with_npz(prompt, input_wav_file):
|
|
116 |
)
|
117 |
|
118 |
# Print again the contents
|
|
|
119 |
for item in contents:
|
120 |
print(item)
|
121 |
|
|
|
9 |
model_ids = [
|
10 |
'suno/bark',
|
11 |
]
|
12 |
+
|
13 |
for model_id in model_ids:
|
14 |
model_name = model_id.split('/')[-1]
|
15 |
snapshot_download(model_id, local_dir=f'checkpoints/{model_name}')
|
|
|
19 |
|
20 |
config = BarkConfig()
|
21 |
model = Bark.init_from_config(config)
|
22 |
+
model.load_checkpoint(config, checkpoint_dir="checkpoints/bark", eval=True).to("cuda:0")
|
23 |
|
24 |
def infer(prompt, input_wav_file):
|
25 |
|
|
|
117 |
)
|
118 |
|
119 |
# Print again the contents
|
120 |
+
contents = os.listdir(f"bark_voices/{file_name}")
|
121 |
for item in contents:
|
122 |
print(item)
|
123 |
|