XzJosh commited on
Commit
af3a9fd
1 Parent(s): 15f30aa

Upload infer.py

Browse files
Files changed (1) hide show
  1. infer.py +11 -11
infer.py CHANGED
@@ -18,8 +18,8 @@ import numpy as np
18
  from models import SynthesizerTrn
19
  from text.symbols import symbols
20
 
21
- from oldVersion.V210.models import SynthesizerTrn as V210SynthesizerTrn
22
- from oldVersion.V210.text import symbols as V210symbols
23
  from oldVersion.V200.models import SynthesizerTrn as V200SynthesizerTrn
24
  from oldVersion.V200.text import symbols as V200symbols
25
  from oldVersion.V111.models import SynthesizerTrn as V111SynthesizerTrn
@@ -29,14 +29,14 @@ from oldVersion.V110.text import symbols as V110symbols
29
  from oldVersion.V101.models import SynthesizerTrn as V101SynthesizerTrn
30
  from oldVersion.V101.text import symbols as V101symbols
31
 
32
- from oldVersion import V111, V110, V101, V200
33
 
34
  # 当前版本信息
35
  latest_version = "2.2"
36
 
37
  # 版本兼容
38
  SynthesizerTrnMap = {
39
- "2.1": V210SynthesizerTrn,
40
  "2.0.2-fix": V200SynthesizerTrn,
41
  "2.0.1": V200SynthesizerTrn,
42
  "2.0": V200SynthesizerTrn,
@@ -50,7 +50,7 @@ SynthesizerTrnMap = {
50
  }
51
 
52
  symbolsMap = {
53
- "2.1": V210symbols,
54
  "2.0.2-fix": V200symbols,
55
  "2.0.1": V200symbols,
56
  "2.0": V200symbols,
@@ -116,15 +116,15 @@ def get_text(text, language_str, hps, device):
116
 
117
  if language_str == "ZH":
118
  bert = bert_ori
119
- ja_bert = torch.rand(1024, len(phone))
120
- en_bert = torch.rand(1024, len(phone))
121
  elif language_str == "JP":
122
- bert = torch.rand(1024, len(phone))
123
  ja_bert = bert_ori
124
- en_bert = torch.rand(1024, len(phone))
125
  elif language_str == "EN":
126
- bert = torch.rand(1024, len(phone))
127
- ja_bert = torch.rand(1024, len(phone))
128
  en_bert = bert_ori
129
  else:
130
  raise ValueError("language_str should be ZH, JP or EN")
 
18
  from models import SynthesizerTrn
19
  from text.symbols import symbols
20
 
21
+ # from oldVersion.V210.models import SynthesizerTrn as V210SynthesizerTrn
22
+ # from oldVersion.V210.text import symbols as V210symbols
23
  from oldVersion.V200.models import SynthesizerTrn as V200SynthesizerTrn
24
  from oldVersion.V200.text import symbols as V200symbols
25
  from oldVersion.V111.models import SynthesizerTrn as V111SynthesizerTrn
 
29
  from oldVersion.V101.models import SynthesizerTrn as V101SynthesizerTrn
30
  from oldVersion.V101.text import symbols as V101symbols
31
 
32
+ from oldVersion import V111, V110, V101, V200 # , V210
33
 
34
  # 当前版本信息
35
  latest_version = "2.2"
36
 
37
  # 版本兼容
38
  SynthesizerTrnMap = {
39
+ # "2.1": V210SynthesizerTrn,
40
  "2.0.2-fix": V200SynthesizerTrn,
41
  "2.0.1": V200SynthesizerTrn,
42
  "2.0": V200SynthesizerTrn,
 
50
  }
51
 
52
  symbolsMap = {
53
+ # "2.1": V210symbols,
54
  "2.0.2-fix": V200symbols,
55
  "2.0.1": V200symbols,
56
  "2.0": V200symbols,
 
116
 
117
  if language_str == "ZH":
118
  bert = bert_ori
119
+ ja_bert = torch.zeros(1024, len(phone))
120
+ en_bert = torch.zeros(1024, len(phone))
121
  elif language_str == "JP":
122
+ bert = torch.zeros(1024, len(phone))
123
  ja_bert = bert_ori
124
+ en_bert = torch.zeros(1024, len(phone))
125
  elif language_str == "EN":
126
+ bert = torch.zeros(1024, len(phone))
127
+ ja_bert = torch.zeros(1024, len(phone))
128
  en_bert = bert_ori
129
  else:
130
  raise ValueError("language_str should be ZH, JP or EN")