Spaces:
Runtime error
Runtime error
Commit
·
6bb339b
1
Parent(s):
5330866
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,19 @@
|
|
1 |
-
|
2 |
-
from
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fairseq.checkpoint_utils import load_model_ensemble_and_task_from_hf_hub
|
2 |
+
from fairseq.models.text_to_speech.hub_interface import TTSHubInterface
|
3 |
+
import IPython.display as ipd
|
4 |
+
|
5 |
+
|
6 |
+
models, cfg, task = load_model_ensemble_and_task_from_hf_hub(
|
7 |
+
"facebook/tts_transformer-tr-cv7",
|
8 |
+
arg_overrides={"vocoder": "hifigan", "fp16": False}
|
9 |
+
)
|
10 |
+
model = models[0]
|
11 |
+
TTSHubInterface.update_cfg_with_data_cfg(cfg, task.data_cfg)
|
12 |
+
generator = task.build_generator(model, cfg)
|
13 |
+
|
14 |
+
text = "Merhaba, bu bir deneme çalışmasıdır."
|
15 |
+
|
16 |
+
sample = TTSHubInterface.get_model_input(task, text)
|
17 |
+
wav, rate = TTSHubInterface.get_prediction(task, model, generator, sample)
|
18 |
+
|
19 |
+
ipd.Audio(wav, rate=rate)
|