Spaces:
Running
Running
seawolf2357
commited on
Update app.py
Browse files
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 |
-
"
|
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.
|
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'] λ±
|