seawolf2357 commited on
Commit
59ff24b
Β·
verified Β·
1 Parent(s): e445cb2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -9,7 +9,7 @@ def generate_music(prompt):
9
  # audioldm API μ‚¬μš©ν•˜μ—¬ μŒμ•… 생성 API 호좜
10
  client = Client("https://haoheliu-audioldm2-text2audio-text2music.hf.space/")
11
  result = client.predict(
12
- "classic music", # str in 'Input text' Textbox component
13
  "Low quality.", # str in 'Negative prompt' Textbox component
14
  5, # int | float (numeric value between 5 and 15) in 'Duration (seconds)' Slider component
15
  6.5, # int | float (numeric value between 0 and 7) in 'Guidance scale' Slider component
@@ -40,9 +40,9 @@ def classify_and_generate_voice(uploaded_image):
40
  top_prediction = predictions[0]['label'] # κ°€μž₯ ν™•λ₯ μ΄ 높은 λΆ„λ₯˜ κ²°κ³Ό
41
 
42
  # μŒμ„± 생성
43
- voice_result = generate_voice("this is" + top_prediction)
44
  # μŒμ•… 생성
45
- music_result = generate_music("The rnb beat of 85BPM drums. playing Violin," + top_prediction)
46
 
47
  # λ°˜ν™˜λœ μŒμ„± 및 μŒμ•… κ²°κ³Όλ₯Ό Gradio μΈν„°νŽ˜μ΄μŠ€λ‘œ 전달
48
  # 예: voice_result['url'] λ˜λŠ” voice_result['audio_data'] λ“±
 
9
  # audioldm API μ‚¬μš©ν•˜μ—¬ μŒμ•… 생성 API 호좜
10
  client = Client("https://haoheliu-audioldm2-text2audio-text2music.hf.space/")
11
  result = client.predict(
12
+ "playing piano.", # str in 'Input text' Textbox component
13
  "Low quality.", # str in 'Negative prompt' Textbox component
14
  5, # int | float (numeric value between 5 and 15) in 'Duration (seconds)' Slider component
15
  6.5, # int | float (numeric value between 0 and 7) in 'Guidance scale' Slider component
 
40
  top_prediction = predictions[0]['label'] # κ°€μž₯ ν™•λ₯ μ΄ 높은 λΆ„λ₯˜ κ²°κ³Ό
41
 
42
  # μŒμ„± 생성
43
+ voice_result = generate_voice("this is " + top_prediction)
44
  # μŒμ•… 생성
45
+ music_result = generate_music("The rnb beat of 85BPM drums." + top_prediction + ".")
46
 
47
  # λ°˜ν™˜λœ μŒμ„± 및 μŒμ•… κ²°κ³Όλ₯Ό Gradio μΈν„°νŽ˜μ΄μŠ€λ‘œ 전달
48
  # 예: voice_result['url'] λ˜λŠ” voice_result['audio_data'] λ“±