Spaces:
Running
Running
seawolf2357
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -6,19 +6,22 @@ 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 |
-
|
13 |
-
|
14 |
-
5,
|
15 |
-
5
|
16 |
-
|
17 |
-
|
18 |
-
api_name="/text2audio"
|
19 |
)
|
|
|
|
|
20 |
print(result)
|
21 |
-
#audio_result = extract_audio(result)
|
22 |
return result
|
23 |
|
24 |
def generate_voice(prompt):
|
|
|
6 |
image_model = pipeline("image-classification", model="google/vit-base-patch16-224")
|
7 |
|
8 |
def generate_music(prompt):
|
|
|
9 |
client = Client("https://haoheliu-audioldm-48k-text-to-hifiaudio-generation.hf.space/")
|
10 |
+
|
11 |
+
# Assuming the API requires these five arguments: prompt, duration, guidance_scale, seed, and num_waveforms
|
12 |
+
# Adjust the names and values according to the API's actual requirements
|
13 |
result = client.predict(
|
14 |
+
prompt=prompt,
|
15 |
+
duration=5,
|
16 |
+
guidance_scale=5.5,
|
17 |
+
seed=5,
|
18 |
+
num_waveforms=3,
|
19 |
+
# Remove the api_name if it's not expected/needed, or adjust accordingly
|
20 |
+
# api_name="/text2audio" # Comment this out if api_name is not an expected argument
|
21 |
)
|
22 |
+
|
23 |
+
# Process the result
|
24 |
print(result)
|
|
|
25 |
return result
|
26 |
|
27 |
def generate_voice(prompt):
|