move to device
Browse files
app.py
CHANGED
|
@@ -2,7 +2,7 @@ import os
|
|
| 2 |
|
| 3 |
import gradio as gr
|
| 4 |
import torch
|
| 5 |
-
from styletts2importable import compute_style, inference
|
| 6 |
from txtsplit import txtsplit
|
| 7 |
import numpy as np
|
| 8 |
import phonemizer
|
|
@@ -35,7 +35,7 @@ global_phonemizer = phonemizer.backend.EspeakBackend(
|
|
| 35 |
for v in voicelist:
|
| 36 |
cache_path = f"voices/{v}.wav.npy"
|
| 37 |
if os.path.exists(cache_path):
|
| 38 |
-
voices[v] = torch.from_numpy(np.load(cache_path))
|
| 39 |
else:
|
| 40 |
style = compute_style(f"voices/{v}.wav")
|
| 41 |
voices[v] = style
|
|
|
|
| 2 |
|
| 3 |
import gradio as gr
|
| 4 |
import torch
|
| 5 |
+
from styletts2importable import compute_style, device, inference
|
| 6 |
from txtsplit import txtsplit
|
| 7 |
import numpy as np
|
| 8 |
import phonemizer
|
|
|
|
| 35 |
for v in voicelist:
|
| 36 |
cache_path = f"voices/{v}.wav.npy"
|
| 37 |
if os.path.exists(cache_path):
|
| 38 |
+
voices[v] = torch.from_numpy(np.load(cache_path)).to(device)
|
| 39 |
else:
|
| 40 |
style = compute_style(f"voices/{v}.wav")
|
| 41 |
voices[v] = style
|