Spaces:
Runtime error
Runtime error
Florian Lux
commited on
Commit
β’
f23c138
1
Parent(s):
cea6632
add infrastructure to automatically download the models
Browse files
README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
---
|
2 |
-
title: IMS Toucan
|
3 |
emoji: π¦
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
7 |
app_file: app.py
|
8 |
pinned: false
|
|
|
1 |
---
|
2 |
+
title: IMS Toucan Multilingual TTS
|
3 |
emoji: π¦
|
4 |
+
colorFrom: green
|
5 |
+
colorTo: yellow
|
6 |
sdk: gradio
|
7 |
app_file: app.py
|
8 |
pinned: false
|
app.py
CHANGED
@@ -1,3 +1,6 @@
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
import numpy as np
|
3 |
import torch
|
@@ -26,6 +29,10 @@ class TTS_Interface:
|
|
26 |
def __init__(self):
|
27 |
self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
28 |
self.model = Meta_FastSpeech2(device=self.device)
|
|
|
|
|
|
|
|
|
29 |
|
30 |
def read(self, prompt, language):
|
31 |
language_id_lookup = {
|
|
|
1 |
+
import os
|
2 |
+
|
3 |
+
import gdown
|
4 |
import gradio as gr
|
5 |
import numpy as np
|
6 |
import torch
|
|
|
29 |
def __init__(self):
|
30 |
self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
31 |
self.model = Meta_FastSpeech2(device=self.device)
|
32 |
+
os.makedirs("Models/HiFiGAN_combined", exist_ok=True)
|
33 |
+
os.makedirs("Models/FastSpeech2_Meta", exist_ok=True)
|
34 |
+
gdown.download(url="https://drive.google.com/uc?id=1-AhjmCR6DDI6rtzPIn9ksOxQyHKf6CbG", output="Models/FastSpeech2_Meta/best.pt")
|
35 |
+
gdown.download(url="https://drive.google.com/uc?id=1-5sP-0JDUvKTjxhO3hUVJgArSUjuhU6P", output="Models/HiFiGAN_combined/best.pt")
|
36 |
|
37 |
def read(self, prompt, language):
|
38 |
language_id_lookup = {
|