Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -82,61 +82,31 @@ def generate_audio(prompt, seconds_total=30, steps=100, cfg_scale=7):
|
|
82 |
# Return the path to the generated audio file
|
83 |
return unique_filename
|
84 |
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
5, # CFG Scale
|
111 |
-
],
|
112 |
-
[
|
113 |
-
"Simulate a forest ambiance with birds chirping and wind rustling through the leaves.", # Text prompt
|
114 |
-
60, # Duration in Seconds
|
115 |
-
140, # Number of Diffusion Steps
|
116 |
-
7.5, # CFG Scale
|
117 |
-
],
|
118 |
-
[
|
119 |
-
"Recreate a gentle rainfall with distant thunder.", # Text prompt
|
120 |
-
|
121 |
-
35, # Duration in Seconds
|
122 |
-
110, # Number of Diffusion Steps
|
123 |
-
8, # CFG Scale
|
124 |
-
|
125 |
-
],
|
126 |
-
[
|
127 |
-
"Imagine a jazz cafe environment with soft music and ambient chatter.", # Text prompt
|
128 |
-
25, # Duration in Seconds
|
129 |
-
90, # Number of Diffusion Steps
|
130 |
-
6, # CFG Scale
|
131 |
-
|
132 |
-
],
|
133 |
-
["Rock beat played in a treated studio, session drumming on an acoustic kit.",
|
134 |
-
30, # Duration in Seconds
|
135 |
-
100, # Number of Diffusion Steps
|
136 |
-
7, # CFG Scale
|
137 |
-
|
138 |
-
]
|
139 |
-
])
|
140 |
|
141 |
|
142 |
# Pre-load the model to avoid multiprocessing issues
|
|
|
82 |
# Return the path to the generated audio file
|
83 |
return unique_filename
|
84 |
|
85 |
+
|
86 |
+
DESCRIPTION = "Welcome to Raptor APIs"
|
87 |
+
|
88 |
+
|
89 |
+
css = """
|
90 |
+
#output {
|
91 |
+
height: 500px;
|
92 |
+
overflow: auto;
|
93 |
+
border: 1px solid #ccc;
|
94 |
+
}
|
95 |
+
"""
|
96 |
+
|
97 |
+
with gr.Blocks(css=css) as demo:
|
98 |
+
gr.Markdown(DESCRIPTION)
|
99 |
+
with gr.Tab(label="GenAudio"):
|
100 |
+
with gr.Row():
|
101 |
+
with gr.Column
|
102 |
+
prompt = gr.Textbox(label="Prompt", placeholder="Enter your text prompt here"),
|
103 |
+
duration = gr.Slider(0, 47, value=30, label="Duration in Seconds"),
|
104 |
+
steps = gr.Slider(10, 150, value=100, step=10, label="Number of Diffusion Steps"),
|
105 |
+
cfg = gr.Slider(1, 15, value=7, step=0.1, label="CFG Scale"),
|
106 |
+
|
107 |
+
mask_btn.click(generate_audio,input=[prompt,duration, steps, cfg],output=output,api_name="genAudio")
|
108 |
+
with gr.Column():
|
109 |
+
output = gr.Image(label="audio")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
|
111 |
|
112 |
# Pre-load the model to avoid multiprocessing issues
|