Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -170,48 +170,48 @@ with iface:
|
|
| 170 |
)
|
| 171 |
|
| 172 |
with gr.Group():
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
)
|
| 181 |
-
negative_textbox = gr.Textbox(
|
| 182 |
-
value="low quality, average quality",
|
| 183 |
-
max_lines=1,
|
| 184 |
-
label="Negative prompt",
|
| 185 |
-
info="Enter a negative prompt not to guide the audio generation. Selecting appropriate negative prompts can improve the audio quality significantly.",
|
| 186 |
-
elem_id="prompt-in",
|
| 187 |
-
)
|
| 188 |
-
|
| 189 |
-
with gr.Accordion("Click to modify detailed configurations", open=False):
|
| 190 |
-
seed = gr.Number(
|
| 191 |
-
value=45,
|
| 192 |
-
label="Seed",
|
| 193 |
-
info="Change this value (any integer number) will lead to a different generation result.",
|
| 194 |
-
)
|
| 195 |
-
duration = gr.Slider(2.5, 10, value=5, step=2.5, label="Duration (seconds)")
|
| 196 |
-
guidance_scale = gr.Slider(
|
| 197 |
-
0,
|
| 198 |
-
5,
|
| 199 |
-
value=3.5,
|
| 200 |
-
step=0.5,
|
| 201 |
-
label="Guidance scale",
|
| 202 |
-
info="Large => better quality and relevancy to text; Small => better diversity",
|
| 203 |
)
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
info="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",
|
| 211 |
)
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 215 |
|
| 216 |
with gr.Group(elem_id="share-btn-container", visible=False):
|
| 217 |
community_icon = gr.HTML(community_icon_html)
|
|
@@ -224,7 +224,7 @@ with iface:
|
|
| 224 |
outputs=[outputs],
|
| 225 |
)
|
| 226 |
|
| 227 |
-
share_button.click(None, [], []
|
| 228 |
gr.HTML(
|
| 229 |
"""
|
| 230 |
<div class="footer" style="text-align: center; max-width: 700px; margin: 0 auto;">
|
|
|
|
| 170 |
)
|
| 171 |
|
| 172 |
with gr.Group():
|
| 173 |
+
with gr.Blocks():
|
| 174 |
+
textbox = gr.Textbox(
|
| 175 |
+
value="A hammer is hitting a wooden surface",
|
| 176 |
+
max_lines=1,
|
| 177 |
+
label="Input text",
|
| 178 |
+
info="Your text is important for the audio quality. Please ensure it is descriptive by using more adjectives.",
|
| 179 |
+
elem_id="prompt-in",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 180 |
)
|
| 181 |
+
negative_textbox = gr.Textbox(
|
| 182 |
+
value="low quality, average quality",
|
| 183 |
+
max_lines=1,
|
| 184 |
+
label="Negative prompt",
|
| 185 |
+
info="Enter a negative prompt not to guide the audio generation. Selecting appropriate negative prompts can improve the audio quality significantly.",
|
| 186 |
+
elem_id="prompt-in",
|
|
|
|
| 187 |
)
|
| 188 |
+
|
| 189 |
+
with gr.Accordion("Click to modify detailed configurations", open=False):
|
| 190 |
+
seed = gr.Number(
|
| 191 |
+
value=45,
|
| 192 |
+
label="Seed",
|
| 193 |
+
info="Change this value (any integer number) will lead to a different generation result.",
|
| 194 |
+
)
|
| 195 |
+
duration = gr.Slider(2.5, 10, value=5, step=2.5, label="Duration (seconds)")
|
| 196 |
+
guidance_scale = gr.Slider(
|
| 197 |
+
0,
|
| 198 |
+
5,
|
| 199 |
+
value=3.5,
|
| 200 |
+
step=0.5,
|
| 201 |
+
label="Guidance scale",
|
| 202 |
+
info="Large => better quality and relevancy to text; Small => better diversity",
|
| 203 |
+
)
|
| 204 |
+
n_candidates = gr.Slider(
|
| 205 |
+
1,
|
| 206 |
+
3,
|
| 207 |
+
value=3,
|
| 208 |
+
step=1,
|
| 209 |
+
label="Number waveforms to generate",
|
| 210 |
+
info="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",
|
| 211 |
+
)
|
| 212 |
+
|
| 213 |
+
outputs = gr.Video(label="Output", elem_id="output-video")
|
| 214 |
+
btn = gr.Button("Submit", elem_id=".gr-Button") # .style(full_width=True)
|
| 215 |
|
| 216 |
with gr.Group(elem_id="share-btn-container", visible=False):
|
| 217 |
community_icon = gr.HTML(community_icon_html)
|
|
|
|
| 224 |
outputs=[outputs],
|
| 225 |
)
|
| 226 |
|
| 227 |
+
share_button.click(None, [], [], js=share_js)
|
| 228 |
gr.HTML(
|
| 229 |
"""
|
| 230 |
<div class="footer" style="text-align: center; max-width: 700px; margin: 0 auto;">
|