Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,19 @@
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
import torch
|
4 |
-
from transformers import BarkModel
|
5 |
-
from optimum.bettertransformer import BetterTransformer
|
6 |
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
|
10 |
from TTS.tts.configs.bark_config import BarkConfig
|
@@ -12,7 +21,7 @@ from TTS.tts.models.bark import Bark
|
|
12 |
|
13 |
config = BarkConfig()
|
14 |
model = Bark.init_from_config(config)
|
15 |
-
model.load_checkpoint(config, checkpoint_dir=
|
16 |
|
17 |
def infer(prompt):
|
18 |
|
|
|
1 |
import gradio as gr
|
2 |
|
|
|
|
|
|
|
3 |
|
4 |
+
|
5 |
+
from huggingface_hub import snapshot_download
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
+
|
10 |
+
model_ids = [
|
11 |
+
'suno/bark',
|
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}')
|
16 |
+
|
17 |
|
18 |
|
19 |
from TTS.tts.configs.bark_config import BarkConfig
|
|
|
21 |
|
22 |
config = BarkConfig()
|
23 |
model = Bark.init_from_config(config)
|
24 |
+
model.load_checkpoint(config, checkpoint_dir="checkpoints/bark", eval=True)
|
25 |
|
26 |
def infer(prompt):
|
27 |
|