Spaces:
Running
on
T4
Running
on
T4
try to figure out how ZeroGPU works
Browse files
app.py
CHANGED
@@ -21,10 +21,10 @@ from Utility.storage_config import MODELS_DIR
|
|
21 |
|
22 |
class ControllableInterface(torch.nn.Module):
|
23 |
|
24 |
-
def __init__(self, available_artificial_voices=1000):
|
25 |
super().__init__()
|
26 |
self.model = ToucanTTSInterface(device="cpu", tts_model_path="Meta")
|
27 |
-
self.wgan =
|
28 |
self.generated_speaker_embeds = list()
|
29 |
self.available_artificial_voices = available_artificial_voices
|
30 |
self.current_language = ""
|
@@ -124,7 +124,8 @@ available_artificial_voices = 1000
|
|
124 |
path_to_iso_list = "Preprocessing/multilinguality/iso_to_fullname.json"
|
125 |
iso_to_name = load_json_from_path(path_to_iso_list)
|
126 |
text_selection = [f"{iso_to_name[iso_code]} Text ({iso_code})" for iso_code in iso_to_name]
|
127 |
-
|
|
|
128 |
|
129 |
|
130 |
def read(prompt,
|
|
|
21 |
|
22 |
class ControllableInterface(torch.nn.Module):
|
23 |
|
24 |
+
def __init__(self, gan_wrapper, available_artificial_voices=1000):
|
25 |
super().__init__()
|
26 |
self.model = ToucanTTSInterface(device="cpu", tts_model_path="Meta")
|
27 |
+
self.wgan = gan_wrapper
|
28 |
self.generated_speaker_embeds = list()
|
29 |
self.available_artificial_voices = available_artificial_voices
|
30 |
self.current_language = ""
|
|
|
124 |
path_to_iso_list = "Preprocessing/multilinguality/iso_to_fullname.json"
|
125 |
iso_to_name = load_json_from_path(path_to_iso_list)
|
126 |
text_selection = [f"{iso_to_name[iso_code]} Text ({iso_code})" for iso_code in iso_to_name]
|
127 |
+
gw = GanWrapper(os.path.join(MODELS_DIR, "Embedding", "embedding_gan.pt"), device="cuda" if torch.cuda.is_available() else "cpu")
|
128 |
+
controllable_ui = ControllableInterface(gan_wrapper=gw, available_artificial_voices=available_artificial_voices)
|
129 |
|
130 |
|
131 |
def read(prompt,
|