Spaces:
Starting
on
T4
Starting
on
T4
Update app.py
Browse files
app.py
CHANGED
|
@@ -367,6 +367,42 @@ with demo:
|
|
| 367 |
"""
|
| 368 |
)
|
| 369 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 370 |
with gr.TabItem("Chat with Aya") as chat_with_aya:
|
| 371 |
cid = gr.State("")
|
| 372 |
token = gr.State(value=None)
|
|
@@ -468,41 +504,6 @@ with demo:
|
|
| 468 |
with gr.Accordion("See Details", open=False):
|
| 469 |
gr.Markdown("This space uses Aya Expanse for translating multilingual prompts and generating detailed image descriptions and [Flux Schnell](https://huggingface.co/black-forest-labs/FLUX.1-schnell) for Image Generation.")
|
| 470 |
|
| 471 |
-
|
| 472 |
-
# Generate Images
|
| 473 |
-
with gr.TabItem("Aya Vision") as see_with_aya:
|
| 474 |
-
with gr.Row():
|
| 475 |
-
with gr.Column():
|
| 476 |
-
aya_vision_prompt = gr.Textbox(placeholder="Ask anything in our 23 languages ...", label="Input Prompt", lines=3)
|
| 477 |
-
aya_vision_input_img = gr.Image(label="Input Image", interactive=True, type="filepath")
|
| 478 |
-
submit_aya_vision = gr.Button(value="Submit", variant="primary")
|
| 479 |
-
clear_button_aya_vision = gr.ClearButton()
|
| 480 |
-
with gr.Column():
|
| 481 |
-
aya_vision_response = gr.Textbox(lines=3,label="Aya Vision's Response", show_copy_button=True, container=True, interactive=False)
|
| 482 |
-
lang_textbox = gr.Textbox(visible=False)
|
| 483 |
-
|
| 484 |
-
with gr.Row():
|
| 485 |
-
gr.Examples(
|
| 486 |
-
examples=[[lang] for lang in AYA_VISION_PROMPT_EXAMPLES.keys()],
|
| 487 |
-
inputs=lang_textbox,
|
| 488 |
-
outputs=[aya_vision_prompt, aya_vision_input_img],
|
| 489 |
-
fn=get_aya_vision_prompt_example,
|
| 490 |
-
label="Load example prompt for:",
|
| 491 |
-
examples_per_page=25,
|
| 492 |
-
run_on_click=True
|
| 493 |
-
)
|
| 494 |
-
|
| 495 |
-
# increase spacing between examples and Accordion components
|
| 496 |
-
with gr.Row():
|
| 497 |
-
pass
|
| 498 |
-
with gr.Row():
|
| 499 |
-
pass
|
| 500 |
-
with gr.Row():
|
| 501 |
-
pass
|
| 502 |
-
|
| 503 |
-
with gr.Row():
|
| 504 |
-
with gr.Accordion("See Details", open=False):
|
| 505 |
-
gr.Markdown("This space uses [Aya Vision](https://huggingface.co/CohereForAI/aya-vision-32b) for understanding images.")
|
| 506 |
|
| 507 |
|
| 508 |
# Aya Vision
|
|
|
|
| 367 |
"""
|
| 368 |
)
|
| 369 |
|
| 370 |
+
# Generate Images
|
| 371 |
+
with gr.TabItem("Aya Vision") as see_with_aya:
|
| 372 |
+
with gr.Row():
|
| 373 |
+
with gr.Column():
|
| 374 |
+
aya_vision_prompt = gr.Textbox(placeholder="Ask anything in our 23 languages ...", label="Input Prompt", lines=3)
|
| 375 |
+
aya_vision_input_img = gr.Image(label="Input Image", interactive=True, type="filepath")
|
| 376 |
+
submit_aya_vision = gr.Button(value="Submit", variant="primary")
|
| 377 |
+
clear_button_aya_vision = gr.ClearButton()
|
| 378 |
+
with gr.Column():
|
| 379 |
+
aya_vision_response = gr.Textbox(lines=3,label="Aya Vision's Response", show_copy_button=True, container=True, interactive=False)
|
| 380 |
+
lang_textbox = gr.Textbox(visible=False)
|
| 381 |
+
|
| 382 |
+
with gr.Row():
|
| 383 |
+
gr.Examples(
|
| 384 |
+
examples=[[lang] for lang in AYA_VISION_PROMPT_EXAMPLES.keys()],
|
| 385 |
+
inputs=lang_textbox,
|
| 386 |
+
outputs=[aya_vision_prompt, aya_vision_input_img],
|
| 387 |
+
fn=get_aya_vision_prompt_example,
|
| 388 |
+
label="Load example prompt for:",
|
| 389 |
+
examples_per_page=25,
|
| 390 |
+
run_on_click=True
|
| 391 |
+
)
|
| 392 |
+
|
| 393 |
+
# increase spacing between examples and Accordion components
|
| 394 |
+
with gr.Row():
|
| 395 |
+
pass
|
| 396 |
+
with gr.Row():
|
| 397 |
+
pass
|
| 398 |
+
with gr.Row():
|
| 399 |
+
pass
|
| 400 |
+
|
| 401 |
+
with gr.Row():
|
| 402 |
+
with gr.Accordion("See Details", open=False):
|
| 403 |
+
gr.Markdown("This space uses [Aya Vision](https://huggingface.co/CohereForAI/aya-vision-32b) for understanding images.")
|
| 404 |
+
|
| 405 |
+
|
| 406 |
with gr.TabItem("Chat with Aya") as chat_with_aya:
|
| 407 |
cid = gr.State("")
|
| 408 |
token = gr.State(value=None)
|
|
|
|
| 504 |
with gr.Accordion("See Details", open=False):
|
| 505 |
gr.Markdown("This space uses Aya Expanse for translating multilingual prompts and generating detailed image descriptions and [Flux Schnell](https://huggingface.co/black-forest-labs/FLUX.1-schnell) for Image Generation.")
|
| 506 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 507 |
|
| 508 |
|
| 509 |
# Aya Vision
|