kevinwang676 commited on
Commit
b6ba1c9
·
verified ·
1 Parent(s): 738ff09

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -20,12 +20,14 @@ logging.getLogger('matplotlib').setLevel(logging.WARNING)
20
  config_json = "egs/visinger2/config.json"
21
  model_path = "G_157000.pth"
22
 
 
23
 
24
  hps = utils.get_hparams_from_file(config_json)
25
  net_g = SynthesizerTrn(hps)
26
  _ = net_g.eval()
27
  _ = utils.load_checkpoint(model_path, net_g, None)
28
 
 
29
  def vc_fn(speaker, ds, vc_transform):
30
  try:
31
  ds = json.loads(ds)
@@ -72,7 +74,7 @@ with app:
72
 
73
  在线推理限制为总时长小于2分钟,且单个切片时长小于30s,有更大需求请下载本仓库或github仓库代码运行ds_inference.py进行本地推理
74
  """)
75
- sid = gr.Dropdown(label="音色", choices=["taffy", "otto"], value="taffy")
76
  vc_input3 = gr.TextArea(label="ds工程(json格式)",value='''[
77
  {
78
  "text": "SP 清 晨 SP",
 
20
  config_json = "egs/visinger2/config.json"
21
  model_path = "G_157000.pth"
22
 
23
+ import spaces
24
 
25
  hps = utils.get_hparams_from_file(config_json)
26
  net_g = SynthesizerTrn(hps)
27
  _ = net_g.eval()
28
  _ = utils.load_checkpoint(model_path, net_g, None)
29
 
30
+ @spaces.GPU
31
  def vc_fn(speaker, ds, vc_transform):
32
  try:
33
  ds = json.loads(ds)
 
74
 
75
  在线推理限制为总时长小于2分钟,且单个切片时长小于30s,有更大需求请下载本仓库或github仓库代码运行ds_inference.py进行本地推理
76
  """)
77
+ sid = gr.Dropdown(label="音色", choices=["opencpop", "taffy", "otto"], value="opencpop")
78
  vc_input3 = gr.TextArea(label="ds工程(json格式)",value='''[
79
  {
80
  "text": "SP 清 晨 SP",