Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -31,7 +31,7 @@ from llava.mm_utils import (
|
|
31 |
KeywordsStoppingCriteria,
|
32 |
)
|
33 |
|
34 |
-
from
|
35 |
|
36 |
from PIL import Image
|
37 |
|
@@ -334,20 +334,172 @@ with gr.Blocks(
|
|
334 |
|
335 |
print(cur_dir)
|
336 |
gr.Examples(
|
337 |
-
|
338 |
-
[
|
339 |
-
|
340 |
-
|
341 |
-
|
342 |
-
|
343 |
-
|
344 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
345 |
],
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
label="Compare images: "
|
350 |
-
)
|
351 |
|
352 |
chat_msg = chat_input.submit(
|
353 |
add_message, [chatbot, chat_input], [chatbot, chat_input]
|
|
|
31 |
KeywordsStoppingCriteria,
|
32 |
)
|
33 |
|
34 |
+
from serve_constants_mm_llm import html_header
|
35 |
|
36 |
from PIL import Image
|
37 |
|
|
|
334 |
|
335 |
print(cur_dir)
|
336 |
gr.Examples(
|
337 |
+
examples_per_page=20,
|
338 |
+
examples=[
|
339 |
+
[
|
340 |
+
{
|
341 |
+
"files": [
|
342 |
+
f"{cur_dir}/examples/user_example_07.jpg",
|
343 |
+
],
|
344 |
+
"text": "那要我问问你,你这个是什么🐱?",
|
345 |
+
},
|
346 |
+
],
|
347 |
+
[
|
348 |
+
{
|
349 |
+
"files": [
|
350 |
+
f"{cur_dir}/examples/user_example_05.jpg",
|
351 |
+
],
|
352 |
+
"text": "この猫の目の大きさは、どのような理由で他の猫と比べて特に大きく見えますか?",
|
353 |
+
},
|
354 |
+
],
|
355 |
+
[
|
356 |
+
{
|
357 |
+
"files": [
|
358 |
+
f"{cur_dir}/examples/172197131626056_P7966202.png",
|
359 |
+
],
|
360 |
+
"text": "Why this image funny?",
|
361 |
+
},
|
362 |
+
],
|
363 |
+
[
|
364 |
+
{
|
365 |
+
"files": [
|
366 |
+
f"{cur_dir}/examples/norway.jpg",
|
367 |
+
],
|
368 |
+
"text": "Analysieren, in welchem Land diese Szene höchstwahrscheinlich gedreht wurde.",
|
369 |
+
},
|
370 |
+
],
|
371 |
+
[
|
372 |
+
{
|
373 |
+
"files": [
|
374 |
+
f"{cur_dir}/examples/totoro.jpg",
|
375 |
+
],
|
376 |
+
"text": "¿En qué anime aparece esta escena? ¿Puedes presentarlo?",
|
377 |
+
},
|
378 |
+
],
|
379 |
+
[
|
380 |
+
{
|
381 |
+
"files": [
|
382 |
+
f"{cur_dir}/examples/africa.jpg",
|
383 |
+
],
|
384 |
+
"text": "इस तस्वीर में हर एक दृश्य तत्व का क्या प्रतिनिधित्व करता है?",
|
385 |
+
},
|
386 |
+
],
|
387 |
+
[
|
388 |
+
{
|
389 |
+
"files": [
|
390 |
+
f"{cur_dir}/examples/hot_ballon.jpg",
|
391 |
+
],
|
392 |
+
"text": "ฉากบอลลูนลมร้อนในภาพนี้อาจอยู่ที่ไหน? สถานที่นี้มีความพิเศษอย่างไร?",
|
393 |
+
},
|
394 |
+
],
|
395 |
+
[
|
396 |
+
{
|
397 |
+
"files": [
|
398 |
+
f"{cur_dir}/examples/bar.jpg",
|
399 |
+
],
|
400 |
+
"text": "Você pode me dar ideias de design baseadas no tema de coquetéis deste letreiro?",
|
401 |
+
},
|
402 |
+
],
|
403 |
+
[
|
404 |
+
{
|
405 |
+
"files": [
|
406 |
+
f"{cur_dir}/examples/pink_lake.jpg",
|
407 |
+
],
|
408 |
+
"text": "Обясни защо езерото на този остров е в този цвят.",
|
409 |
+
},
|
410 |
+
],
|
411 |
+
[
|
412 |
+
{
|
413 |
+
"files": [
|
414 |
+
f"{cur_dir}/examples/hanzi.jpg",
|
415 |
+
],
|
416 |
+
"text": "Can you describe in Hebrew the evolution process of these four Chinese characters from pictographs to modern characters?",
|
417 |
+
},
|
418 |
+
],
|
419 |
+
[
|
420 |
+
{
|
421 |
+
"files": [
|
422 |
+
f"{cur_dir}/examples/ballon.jpg",
|
423 |
+
],
|
424 |
+
"text": "இந்த காட்சியை விவரிக்கவும், மேலும் இந்த படத்தின் அடிப்படையில் துருக்கியில் இந்த காட்சியுடன் தொடர்பான சில பிரபலமான நிகழ்வுகள் என்ன?",
|
425 |
+
},
|
426 |
+
],
|
427 |
+
[
|
428 |
+
{
|
429 |
+
"files": [
|
430 |
+
f"{cur_dir}/examples/pie.jpg",
|
431 |
+
],
|
432 |
+
"text": "Décrivez ce graphique. Quelles informations pouvons-nous en tirer?",
|
433 |
+
},
|
434 |
+
],
|
435 |
+
[
|
436 |
+
{
|
437 |
+
"files": [
|
438 |
+
f"{cur_dir}/examples/camera.jpg",
|
439 |
+
],
|
440 |
+
"text": "Apa arti dari dua angka di sebelah kiri yang ditampilkan di layar kamera?",
|
441 |
+
},
|
442 |
+
],
|
443 |
+
[
|
444 |
+
{
|
445 |
+
"files": [
|
446 |
+
f"{cur_dir}/examples/dog.jpg",
|
447 |
+
],
|
448 |
+
"text": "이 강아지의 표정을 보고 어떤 기분이나 감정을 느끼고 있는지 설명해 주시겠어요?",
|
449 |
+
},
|
450 |
+
],
|
451 |
+
[
|
452 |
+
{
|
453 |
+
"files": [
|
454 |
+
f"{cur_dir}/examples/book.jpg",
|
455 |
+
],
|
456 |
+
"text": "What language is the text in, and what does the title mean in English?",
|
457 |
+
},
|
458 |
+
],
|
459 |
+
[
|
460 |
+
{
|
461 |
+
"files": [
|
462 |
+
f"{cur_dir}/examples/food.jpg",
|
463 |
+
],
|
464 |
+
"text": "Unaweza kunipa kichocheo cha kutengeneza hii pancake?",
|
465 |
+
},
|
466 |
+
],
|
467 |
+
[
|
468 |
+
{
|
469 |
+
"files": [
|
470 |
+
f"{cur_dir}/examples/line chart.jpg",
|
471 |
+
],
|
472 |
+
"text": "Hãy trình bày những xu hướng mà bạn quan sát được từ biểu đồ và hiện tượng xã hội tiềm ẩn từ đó.",
|
473 |
+
},
|
474 |
+
],
|
475 |
+
[
|
476 |
+
{
|
477 |
+
"files": [
|
478 |
+
f"{cur_dir}/examples/south africa.jpg",
|
479 |
+
],
|
480 |
+
"text": "Waar is hierdie plek? Help my om ’n reisroete vir hierdie land te beplan.",
|
481 |
+
},
|
482 |
+
],
|
483 |
+
[
|
484 |
+
{
|
485 |
+
"files": [
|
486 |
+
f"{cur_dir}/examples/girl.jpg",
|
487 |
+
],
|
488 |
+
"text": "لماذا هذه الصورة مضحكة؟",
|
489 |
+
},
|
490 |
+
],
|
491 |
+
[
|
492 |
+
{
|
493 |
+
"files": [
|
494 |
+
f"{cur_dir}/examples/eagles.jpg",
|
495 |
+
],
|
496 |
+
"text": "Какой креатив должен быть в этом логотипе?",
|
497 |
+
},
|
498 |
+
],
|
499 |
],
|
500 |
+
inputs=[textbox],
|
501 |
+
label="Image",
|
502 |
+
)
|
|
|
|
|
503 |
|
504 |
chat_msg = chat_input.submit(
|
505 |
add_message, [chatbot, chat_input], [chatbot, chat_input]
|