Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ import torch
|
|
5 |
from torch import nn
|
6 |
from torch.nn import functional as F
|
7 |
from torch.utils.data import DataLoader
|
8 |
-
import translators as
|
9 |
|
10 |
import commons
|
11 |
import utils
|
@@ -50,9 +50,9 @@ def infer(text, character, language):
|
|
50 |
if language == '日本語':
|
51 |
pass
|
52 |
elif language == '简体中文':
|
53 |
-
text =
|
54 |
elif language == 'English':
|
55 |
-
text =
|
56 |
char_id = int(character.split(':')[0])
|
57 |
stn_tst = get_text(text, hps)
|
58 |
with torch.no_grad():
|
|
|
5 |
from torch import nn
|
6 |
from torch.nn import functional as F
|
7 |
from torch.utils.data import DataLoader
|
8 |
+
import translators.server as tss
|
9 |
|
10 |
import commons
|
11 |
import utils
|
|
|
50 |
if language == '日本語':
|
51 |
pass
|
52 |
elif language == '简体中文':
|
53 |
+
text = tss.google(text, from_language='zh', to_language='ja')
|
54 |
elif language == 'English':
|
55 |
+
text = tss.google(text, from_language='en', to_language='ja')
|
56 |
char_id = int(character.split(':')[0])
|
57 |
stn_tst = get_text(text, hps)
|
58 |
with torch.no_grad():
|