mitudesk commited on
Commit
cd2bc12
·
1 Parent(s): 45871a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -19,10 +19,7 @@ sid_map = {
19
  "东海帝皇":"teio",
20
  "爱慕织姬":"aimya"
21
  }
22
- sid2_map = {
23
- "录音":"录音",
24
- "文件":"文件"
25
- }
26
 
27
  def vc_fn(sid, input_audio, vc_transform,sid3):
28
  if input_audio is None:
@@ -63,8 +60,6 @@ with app:
63
  "东海帝皇", "米浴","爱慕织姬"], value="东海帝皇")
64
  sid2 = gr.Dropdown(label="上传方式", choices=[
65
  "文件", "录音"], value="文件")
66
- sid3 = gr.Dropdown(label="音色", choices=[
67
- "东海帝皇", "米浴","爱慕织姬"], value="东海帝皇")
68
  vc_input3 = gr.Audio(label="上传音频")
69
  vc_input4 = gr.Audio(source="microphone")
70
  vc_transform = gr.Number(
@@ -76,7 +71,9 @@ with app:
76
  ## 注意
77
  不要使用太长的语音
78
  """)
79
- vc_submit.click(vc_fn, [sid, vc_input3, vc_transform,sid3], [
 
 
80
  vc_output1, vc_output2],api_name="predict")
81
 
82
  app.launch(show_api=True)
 
19
  "东海帝皇":"teio",
20
  "爱慕织姬":"aimya"
21
  }
22
+
 
 
 
23
 
24
  def vc_fn(sid, input_audio, vc_transform,sid3):
25
  if input_audio is None:
 
60
  "东海帝皇", "米浴","爱慕织姬"], value="东海帝皇")
61
  sid2 = gr.Dropdown(label="上传方式", choices=[
62
  "文件", "录音"], value="文件")
 
 
63
  vc_input3 = gr.Audio(label="上传音频")
64
  vc_input4 = gr.Audio(source="microphone")
65
  vc_transform = gr.Number(
 
71
  ## 注意
72
  不要使用太长的语音
73
  """)
74
+ if(sid2=='录音'):
75
+ vc_input3=vc_input4
76
+ vc_submit.click(vc_fn, [sid, vc_input3, vc_transform,sid2], [
77
  vc_output1, vc_output2],api_name="predict")
78
 
79
  app.launch(show_api=True)