Crawford.Zhou commited on
Commit
c144a3b
1 Parent(s): 1736230

支持科比+孙笑川+丁真

Browse files
Files changed (1) hide show
  1. app.py +21 -3
app.py CHANGED
@@ -13,7 +13,7 @@ def greet(name, intensity):
13
  0.5, # int | float (numeric value between 0.1 and 2) in 'Noise' Slider component
14
  0.9, # int | float (numeric value between 0.1 and 2) in 'Noise_W' Slider component
15
  1, # int | float (numeric value between 0.1 and 2) in 'Length' Slider component
16
- "auto", # str (Option from: [('ZH', 'ZH'), ('JP', 'JP'), ('EN', 'EN'), ('auto', 'auto'), ('mix', 'mix')]) in 'Language' Dropdown component
17
  "1.wav",
18
  # str (filepath on your computer (or URL) of file) in 'Audio prompt' Audio component
19
  "Howdy!", # str in 'Text prompt' Textbox component
@@ -28,7 +28,7 @@ def greet(name, intensity):
28
  client = Client("https://xzjosh-sun-bert-vits2.hf.space/--replicas/hclz8/")
29
  result = client.predict(
30
  name, # str in '输入文本内容' Textbox component
31
- "孙笑川", # str (Option from: [('孙笑川', '孙笑川')]) in 'Speaker' Dropdown component
32
  0.5, # int | float (numeric value between 0 and 1) in 'SDP Ratio' Slider component
33
  0.5, # int | float (numeric value between 0.1 and 2) in 'Noise' Slider component
34
  0.9, # int | float (numeric value between 0.1 and 2) in 'Noise_W' Slider component
@@ -41,7 +41,25 @@ def greet(name, intensity):
41
  )
42
  print(result)
43
  return result[1]
44
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
 
46
  demo = gr.Interface(
47
  fn=greet,
 
13
  0.5, # int | float (numeric value between 0.1 and 2) in 'Noise' Slider component
14
  0.9, # int | float (numeric value between 0.1 and 2) in 'Noise_W' Slider component
15
  1, # int | float (numeric value between 0.1 and 2) in 'Length' Slider component
16
+ "auto",
17
  "1.wav",
18
  # str (filepath on your computer (or URL) of file) in 'Audio prompt' Audio component
19
  "Howdy!", # str in 'Text prompt' Textbox component
 
28
  client = Client("https://xzjosh-sun-bert-vits2.hf.space/--replicas/hclz8/")
29
  result = client.predict(
30
  name, # str in '输入文本内容' Textbox component
31
+ "孙笑川", # str (Option from: [('丁真', '丁真')]) in 'Speaker' Dropdown component
32
  0.5, # int | float (numeric value between 0 and 1) in 'SDP Ratio' Slider component
33
  0.5, # int | float (numeric value between 0.1 and 2) in 'Noise' Slider component
34
  0.9, # int | float (numeric value between 0.1 and 2) in 'Noise_W' Slider component
 
41
  )
42
  print(result)
43
  return result[1]
44
+ if intensity == 2:
45
+ client = Client("https://xzjosh-kobe-bert-vits2-2-3.hf.space/--replicas/sk3k7/")
46
+ result = client.predict(
47
+ name, # str in '输入文本内容' Textbox component
48
+ "科比", # r (Option from: [('丁真', '丁真')]) in 'Speaker' Dropdown component
49
+ 0.5, # int | float (numeric value between 0 and 1) in 'SDP Ratio' Slider component
50
+ 0.5, # int | float (numeric value between 0.1 and 2) in 'Noise' Slider component
51
+ 0.9, # int | float (numeric value between 0.1 and 2) in 'Noise_W' Slider component
52
+ 1, # int | float (numeric value between 0.1 and 2) in 'Length' Slider component
53
+ "auto",
54
+ "1.wav",
55
+ "Howdy!", # str in 'Text prompt' Textbox component
56
+ "Text prompt", # str in 'Prompt Mode' Radio component
57
+ "Howdy!", # str in '辅助文本' Textbox component
58
+ 0, # int | float (numeric value between 0 and 1) in 'Weight' Slider component
59
+ fn_index=0
60
+ )
61
+ print(result)
62
+ return result[1]
63
 
64
  demo = gr.Interface(
65
  fn=greet,