seawolf2357 commited on
Commit
0f49e19
ยท
verified ยท
1 Parent(s): 1784bac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -2
app.py CHANGED
@@ -6,7 +6,7 @@ from gradio_client import Client
6
  image_model = pipeline("image-classification", model="google/vit-base-patch16-224")
7
 
8
  def generate_music(prompt):
9
- # audioldm API ์‚ฌ์šฉํ•˜์—ฌ ์Œ์•… ์ƒ์„ฑ API ํ˜ธ์ถœ
10
  client = Client("https://haoheliu-audioldm-48k-text-to-hifiaudio-generation.hf.space/")
11
  result = client.predict(
12
  "playing piano.", # str in 'Input text' Textbox component
@@ -19,7 +19,21 @@ def generate_music(prompt):
19
  )
20
  print(result)
21
  #audio_result = extract_audio(result)
22
- return result
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
 
24
  def generate_voice(prompt):
25
  # Tango API๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์Œ์„ฑ ์ƒ์„ฑ
 
6
  image_model = pipeline("image-classification", model="google/vit-base-patch16-224")
7
 
8
  def generate_music(prompt):
9
+ """ # audioldm API ์‚ฌ์šฉํ•˜์—ฌ ์Œ์•… ์ƒ์„ฑ API ํ˜ธ์ถœ
10
  client = Client("https://haoheliu-audioldm-48k-text-to-hifiaudio-generation.hf.space/")
11
  result = client.predict(
12
  "playing piano.", # str in 'Input text' Textbox component
 
19
  )
20
  print(result)
21
  #audio_result = extract_audio(result)
22
+ return result"""
23
+
24
+ client = Client("https://haoheliu-audioldm-48k-text-to-hifiaudio-generation.hf.space/")
25
+ result = client.predict(
26
+ "Howdy!", # str in 'Input your text here. If the output is not good enough, switching to a different seed will help.' Textbox component
27
+ 5, # int | float (numeric value between 5 and 15)
28
+ in 'Duration (seconds)' Slider component
29
+ 0, # int | float (numeric value between 0 and 6)
30
+ in 'Guidance scale (Large => better quality and relavancy to text; Small => better diversity)' Slider component
31
+ 5, # int | float in 'Change this value (any integer number) will lead to a different generation result.' Number component
32
+ 1, # int | float (numeric value between 1 and 3)
33
+ in 'Automatic quality control. This number control the number of candidates (e.g., generate three audios and choose the best to show you). A Larger value usually lead to better quality with heavier computation' Slider component
34
+ api_name="/text2audio"
35
+ )
36
+ print(result)
37
 
38
  def generate_voice(prompt):
39
  # Tango API๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์Œ์„ฑ ์ƒ์„ฑ