Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,8 +5,6 @@ import re
|
|
5 |
import os
|
6 |
import requests
|
7 |
|
8 |
-
from share_btn import community_icon_html, loading_icon_html, share_js
|
9 |
-
|
10 |
device = "cuda"
|
11 |
|
12 |
is_gpu_busy = False
|
@@ -150,43 +148,6 @@ css = """
|
|
150 |
|
151 |
block = gr.Blocks(css=css)
|
152 |
|
153 |
-
examples = [
|
154 |
-
[
|
155 |
-
'The spirit of a tamagotchi wandering in the city of Paris',
|
156 |
-
# 4,
|
157 |
-
# 45,
|
158 |
-
# 7.5,
|
159 |
-
# 1024,
|
160 |
-
],
|
161 |
-
[
|
162 |
-
'A delicious ceviche cheesecake slice',
|
163 |
-
# 4,
|
164 |
-
# 45,
|
165 |
-
# 7,
|
166 |
-
# 1024,
|
167 |
-
],
|
168 |
-
[
|
169 |
-
'A pao de queijo foodcart in front of a japanese castle',
|
170 |
-
# 4,
|
171 |
-
# 45,
|
172 |
-
# 7,
|
173 |
-
# 1024,
|
174 |
-
],
|
175 |
-
[
|
176 |
-
'alone in the amusement park by Edward Hopper',
|
177 |
-
# 4,
|
178 |
-
# 45,
|
179 |
-
# 7,
|
180 |
-
# 1024,
|
181 |
-
],
|
182 |
-
[
|
183 |
-
"A large cabin on top of a sunny mountain in the style of Dreamworks, artstation",
|
184 |
-
# 4,
|
185 |
-
# 45,
|
186 |
-
# 7,
|
187 |
-
# 1024,
|
188 |
-
],
|
189 |
-
]
|
190 |
|
191 |
|
192 |
with block:
|
@@ -239,10 +200,6 @@ with block:
|
|
239 |
|
240 |
with gr.Group(elem_id="container-advanced-btns"):
|
241 |
advanced_button = gr.Button("Advanced options", elem_id="advanced-btn")
|
242 |
-
with gr.Group(elem_id="share-btn-container"):
|
243 |
-
community_icon = gr.HTML(community_icon_html)
|
244 |
-
loading_icon = gr.HTML(loading_icon_html)
|
245 |
-
share_button = gr.Button("Share to community", elem_id="share-btn")
|
246 |
|
247 |
with gr.Row(elem_id="advanced-options"):
|
248 |
gr.Markdown("Advanced settings are temporarily unavailable")
|
@@ -259,9 +216,6 @@ with block:
|
|
259 |
randomize=True,
|
260 |
)
|
261 |
|
262 |
-
ex = gr.Examples(examples=examples, fn=infer, inputs=text, outputs=[gallery], cache_examples=True, postprocess=False)
|
263 |
-
ex.dataset.headers = [""]
|
264 |
-
|
265 |
text.submit(infer, inputs=text, outputs=[gallery], postprocess=False)
|
266 |
btn.click(infer, inputs=text, outputs=[gallery], postprocess=False)
|
267 |
|
@@ -275,12 +229,6 @@ with block:
|
|
275 |
options.style.display = ["none", ""].includes(options.style.display) ? "flex" : "none";
|
276 |
}""",
|
277 |
)
|
278 |
-
share_button.click(
|
279 |
-
None,
|
280 |
-
[],
|
281 |
-
[],
|
282 |
-
_js=share_js,
|
283 |
-
)
|
284 |
gr.HTML(
|
285 |
"""
|
286 |
<div class="footer">
|
|
|
5 |
import os
|
6 |
import requests
|
7 |
|
|
|
|
|
8 |
device = "cuda"
|
9 |
|
10 |
is_gpu_busy = False
|
|
|
148 |
|
149 |
block = gr.Blocks(css=css)
|
150 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
|
152 |
|
153 |
with block:
|
|
|
200 |
|
201 |
with gr.Group(elem_id="container-advanced-btns"):
|
202 |
advanced_button = gr.Button("Advanced options", elem_id="advanced-btn")
|
|
|
|
|
|
|
|
|
203 |
|
204 |
with gr.Row(elem_id="advanced-options"):
|
205 |
gr.Markdown("Advanced settings are temporarily unavailable")
|
|
|
216 |
randomize=True,
|
217 |
)
|
218 |
|
|
|
|
|
|
|
219 |
text.submit(infer, inputs=text, outputs=[gallery], postprocess=False)
|
220 |
btn.click(infer, inputs=text, outputs=[gallery], postprocess=False)
|
221 |
|
|
|
229 |
options.style.display = ["none", ""].includes(options.style.display) ? "flex" : "none";
|
230 |
}""",
|
231 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
232 |
gr.HTML(
|
233 |
"""
|
234 |
<div class="footer">
|