Update app.py
Browse files
app.py
CHANGED
|
@@ -110,71 +110,70 @@ with iface:
|
|
| 110 |
outputs = gr.Video(label="Output", elem_id="output-video")
|
| 111 |
btn = gr.Button("Submit")
|
| 112 |
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
)
|
| 123 |
|
| 124 |
-
|
| 125 |
-
"""
|
| 126 |
-
<div class="footer" style="text-align: center">
|
| 127 |
-
<p>Share your generations with the community by clicking the share icon at the top right the generated audio!</p>
|
| 128 |
-
<p>Follow the latest update of AudioLDM 2 on our<a href="https://audioldm.github.io/audioldm2"
|
| 129 |
-
style="text-decoration: underline;" target="_blank"> Github repo</a> </p>
|
| 130 |
-
<p>Model by <a
|
| 131 |
-
href="https://twitter.com/LiuHaohe" style="text-decoration: underline;" target="_blank">Haohe
|
| 132 |
-
Liu</a>. Code and demo by 🤗 Hugging Face.</p>
|
| 133 |
-
</div>
|
| 134 |
"""
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 150 |
gr.HTML(
|
| 151 |
"""
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
<
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
</div>
|
| 163 |
-
"""
|
| 164 |
)
|
| 165 |
-
with gr.Accordion("Additional information", open=False):
|
| 166 |
-
gr.HTML(
|
| 167 |
-
"""
|
| 168 |
-
<div class="acknowledgments">
|
| 169 |
-
<p> We build the model with data from <a href="http://research.google.com/audioset/">AudioSet</a>,
|
| 170 |
-
<a href="https://freesound.org/">Freesound</a> and <a
|
| 171 |
-
href="https://sound-effects.bbcrewind.co.uk/">BBC Sound Effect library</a>. We share this demo
|
| 172 |
-
based on the <a
|
| 173 |
-
href="https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/375954/Research.pdf">UK
|
| 174 |
-
copyright exception</a> of data for academic research.
|
| 175 |
-
</p>
|
| 176 |
-
</div>
|
| 177 |
-
"""
|
| 178 |
-
)
|
| 179 |
|
| 180 |
iface.queue(max_size=10).launch()
|
|
|
|
| 110 |
outputs = gr.Video(label="Output", elem_id="output-video")
|
| 111 |
btn = gr.Button("Submit")
|
| 112 |
|
| 113 |
+
# community_icon = gr.HTML(community_icon_html)
|
| 114 |
+
# loading_icon = gr.HTML(loading_icon_html)
|
| 115 |
+
# share_button = gr.Button("Share to community", elem_id="share-btn")
|
| 116 |
+
|
| 117 |
+
btn.click(
|
| 118 |
+
text2audio,
|
| 119 |
+
inputs=[textbox, negative_textbox, duration, guidance_scale, seed, n_candidates],
|
| 120 |
+
outputs=[outputs],
|
| 121 |
+
)
|
|
|
|
| 122 |
|
| 123 |
+
gr.HTML(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 124 |
"""
|
| 125 |
+
<div class="footer" style="text-align: center">
|
| 126 |
+
<p>Share your generations with the community by clicking the share icon at the top right the generated audio!</p>
|
| 127 |
+
<p>Follow the latest update of AudioLDM 2 on our<a href="https://audioldm.github.io/audioldm2"
|
| 128 |
+
style="text-decoration: underline;" target="_blank"> Github repo</a> </p>
|
| 129 |
+
<p>Model by <a
|
| 130 |
+
href="https://twitter.com/LiuHaohe" style="text-decoration: underline;" target="_blank">Haohe
|
| 131 |
+
Liu</a>. Code and demo by 🤗 Hugging Face.</p>
|
| 132 |
+
</div>
|
| 133 |
+
"""
|
| 134 |
+
)
|
| 135 |
+
gr.Examples(
|
| 136 |
+
[
|
| 137 |
+
["A hammer is hitting a wooden surface.", "Low quality.", 10, 3.5, 45, 3],
|
| 138 |
+
["A cat is meowing for attention.", "Low quality.", 10, 3.5, 45, 3],
|
| 139 |
+
["An excited crowd cheering at a sports game.", "Low quality.", 10, 3.5, 45, 3],
|
| 140 |
+
["Birds singing sweetly in a blooming garden.", "Low quality.", 10, 3.5, 45, 3],
|
| 141 |
+
["A modern synthesizer creating futuristic soundscapes.", "Low quality.", 10, 3.5, 45, 3],
|
| 142 |
+
["The vibrant beat of Brazilian samba drums.", "Low quality.", 10, 3.5, 45, 3],
|
| 143 |
+
],
|
| 144 |
+
fn=text2audio,
|
| 145 |
+
inputs=[textbox, negative_textbox, duration, guidance_scale, seed, n_candidates],
|
| 146 |
+
outputs=[outputs],
|
| 147 |
+
# cache_examples=True,
|
| 148 |
+
)
|
| 149 |
+
gr.HTML(
|
| 150 |
+
"""
|
| 151 |
+
<div class="acknowledgements"> <p>Essential Tricks for Enhancing the Quality of Your Generated
|
| 152 |
+
Audio</p>
|
| 153 |
+
<p>1. Try using more adjectives to describe your sound. For example: "A man is speaking
|
| 154 |
+
clearly and slowly in a large room" is better than "A man is speaking".</p>
|
| 155 |
+
<p>2. Try using different random seeds, which can significantly affect the quality of the generated
|
| 156 |
+
output.</p>
|
| 157 |
+
<p>3. It's better to use general terms like 'man' or 'woman' instead of specific names for individuals or
|
| 158 |
+
abstract objects that humans may not be familiar with.</p>
|
| 159 |
+
<p>4. Using a negative prompt to not guide the diffusion process can improve the
|
| 160 |
+
audio quality significantly. Try using negative prompts like 'low quality'.</p>
|
| 161 |
+
</div>
|
| 162 |
+
"""
|
| 163 |
+
)
|
| 164 |
+
with gr.Accordion("Additional information", open=False):
|
| 165 |
gr.HTML(
|
| 166 |
"""
|
| 167 |
+
<div class="acknowledgments">
|
| 168 |
+
<p> We build the model with data from <a href="http://research.google.com/audioset/">AudioSet</a>,
|
| 169 |
+
<a href="https://freesound.org/">Freesound</a> and <a
|
| 170 |
+
href="https://sound-effects.bbcrewind.co.uk/">BBC Sound Effect library</a>. We share this demo
|
| 171 |
+
based on the <a
|
| 172 |
+
href="https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/375954/Research.pdf">UK
|
| 173 |
+
copyright exception</a> of data for academic research.
|
| 174 |
+
</p>
|
| 175 |
+
</div>
|
| 176 |
+
"""
|
|
|
|
|
|
|
| 177 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 178 |
|
| 179 |
iface.queue(max_size=10).launch()
|