Spaces:
Sleeping
Sleeping
Use gr.on
Browse files- README.md +1 -1
- app.py +10 -46
- requirements.txt +3 -2
README.md
CHANGED
@@ -4,7 +4,7 @@ emoji: 💻
|
|
4 |
colorFrom: gray
|
5 |
colorTo: pink
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 3.
|
8 |
python_version: 3.10.11
|
9 |
app_file: app.py
|
10 |
pinned: false
|
|
|
4 |
colorFrom: gray
|
5 |
colorTo: pink
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 3.45.2
|
8 |
python_version: 3.10.11
|
9 |
app_file: app.py
|
10 |
pinned: false
|
app.py
CHANGED
@@ -258,15 +258,8 @@ with gr.Blocks(css="style.css") as demo:
|
|
258 |
api_name="get-token-table",
|
259 |
)
|
260 |
|
261 |
-
|
262 |
-
prompt,
|
263 |
-
token_indices_str,
|
264 |
-
seed,
|
265 |
-
apply_attend_and_excite,
|
266 |
-
num_inference_steps,
|
267 |
-
guidance_scale,
|
268 |
-
]
|
269 |
-
prompt.submit(
|
270 |
fn=randomize_seed_fn,
|
271 |
inputs=[seed, randomize_seed],
|
272 |
outputs=seed,
|
@@ -280,43 +273,14 @@ with gr.Blocks(css="style.css") as demo:
|
|
280 |
api_name=False,
|
281 |
).then(
|
282 |
fn=run,
|
283 |
-
inputs=
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
queue=False,
|
292 |
-
api_name=False,
|
293 |
-
).then(
|
294 |
-
fn=get_token_table,
|
295 |
-
inputs=prompt,
|
296 |
-
outputs=token_indices_table,
|
297 |
-
queue=False,
|
298 |
-
api_name=False,
|
299 |
-
).then(
|
300 |
-
fn=run,
|
301 |
-
inputs=inputs,
|
302 |
-
outputs=result,
|
303 |
-
api_name=False,
|
304 |
-
)
|
305 |
-
run_button.click(
|
306 |
-
fn=randomize_seed_fn,
|
307 |
-
inputs=[seed, randomize_seed],
|
308 |
-
outputs=seed,
|
309 |
-
queue=False,
|
310 |
-
api_name=False,
|
311 |
-
).then(
|
312 |
-
fn=get_token_table,
|
313 |
-
inputs=prompt,
|
314 |
-
outputs=token_indices_table,
|
315 |
-
queue=False,
|
316 |
-
api_name=False,
|
317 |
-
).then(
|
318 |
-
fn=run,
|
319 |
-
inputs=inputs,
|
320 |
outputs=result,
|
321 |
api_name="run",
|
322 |
)
|
|
|
258 |
api_name="get-token-table",
|
259 |
)
|
260 |
|
261 |
+
gr.on(
|
262 |
+
triggers=[prompt.submit, token_indices_str.submit, run_button.click],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
263 |
fn=randomize_seed_fn,
|
264 |
inputs=[seed, randomize_seed],
|
265 |
outputs=seed,
|
|
|
273 |
api_name=False,
|
274 |
).then(
|
275 |
fn=run,
|
276 |
+
inputs=[
|
277 |
+
prompt,
|
278 |
+
token_indices_str,
|
279 |
+
seed,
|
280 |
+
apply_attend_and_excite,
|
281 |
+
num_inference_steps,
|
282 |
+
guidance_scale,
|
283 |
+
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
284 |
outputs=result,
|
285 |
api_name="run",
|
286 |
)
|
requirements.txt
CHANGED
@@ -1,7 +1,8 @@
|
|
1 |
accelerate==0.23.0
|
2 |
diffusers==0.21.2
|
|
|
3 |
Pillow==10.0.1
|
4 |
-
spaces==0.
|
5 |
torch==2.0.0
|
6 |
torchvision==0.15.1
|
7 |
-
transformers==4.33.
|
|
|
1 |
accelerate==0.23.0
|
2 |
diffusers==0.21.2
|
3 |
+
gradio==3.45.2
|
4 |
Pillow==10.0.1
|
5 |
+
spaces==0.15.0
|
6 |
torch==2.0.0
|
7 |
torchvision==0.15.1
|
8 |
+
transformers==4.33.3
|