Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -239,6 +239,7 @@ def bot(history):
|
|
| 239 |
.unsqueeze(0)
|
| 240 |
.to(our_chatbot.model.device)
|
| 241 |
)
|
|
|
|
| 242 |
stop_str = (
|
| 243 |
our_chatbot.conversation.sep
|
| 244 |
if our_chatbot.conversation.sep_style != SeparatorStyle.TWO
|
|
@@ -279,7 +280,7 @@ def bot(history):
|
|
| 279 |
|
| 280 |
# return history
|
| 281 |
generate_kwargs = dict(
|
| 282 |
-
input_ids
|
| 283 |
streamer=streamer,
|
| 284 |
images=image_tensor,
|
| 285 |
max_new_tokens=1024,
|
|
@@ -380,150 +381,150 @@ with gr.Blocks(
|
|
| 380 |
"text": "この猫の目の大きさは、どのような理由で他の猫と比べて特に大きく見えますか?",
|
| 381 |
},
|
| 382 |
],
|
| 383 |
-
|
| 384 |
-
|
| 385 |
-
|
| 386 |
-
|
| 387 |
-
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
| 393 |
-
|
| 394 |
-
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
| 402 |
-
|
| 403 |
-
|
| 404 |
-
|
| 405 |
-
|
| 406 |
-
|
| 407 |
-
|
| 408 |
-
|
| 409 |
-
|
| 410 |
-
|
| 411 |
-
|
| 412 |
-
|
| 413 |
-
|
| 414 |
-
|
| 415 |
-
|
| 416 |
-
|
| 417 |
-
|
| 418 |
-
|
| 419 |
-
|
| 420 |
-
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
| 427 |
-
|
| 428 |
-
|
| 429 |
-
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
| 434 |
-
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
|
| 439 |
-
|
| 440 |
-
|
| 441 |
-
|
| 442 |
-
|
| 443 |
-
|
| 444 |
-
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
|
| 449 |
-
|
| 450 |
-
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
| 478 |
-
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
|
| 488 |
-
|
| 489 |
-
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
|
| 509 |
-
|
| 510 |
-
|
| 511 |
-
|
| 512 |
-
|
| 513 |
-
|
| 514 |
-
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
|
| 523 |
-
|
| 524 |
-
|
| 525 |
-
|
| 526 |
-
|
| 527 |
],
|
| 528 |
inputs=[chat_input],
|
| 529 |
label="Image",
|
|
|
|
| 239 |
.unsqueeze(0)
|
| 240 |
.to(our_chatbot.model.device)
|
| 241 |
)
|
| 242 |
+
|
| 243 |
stop_str = (
|
| 244 |
our_chatbot.conversation.sep
|
| 245 |
if our_chatbot.conversation.sep_style != SeparatorStyle.TWO
|
|
|
|
| 280 |
|
| 281 |
# return history
|
| 282 |
generate_kwargs = dict(
|
| 283 |
+
input_ids,
|
| 284 |
streamer=streamer,
|
| 285 |
images=image_tensor,
|
| 286 |
max_new_tokens=1024,
|
|
|
|
| 381 |
"text": "この猫の目の大きさは、どのような理由で他の猫と比べて特に大きく見えますか?",
|
| 382 |
},
|
| 383 |
],
|
| 384 |
+
[
|
| 385 |
+
{
|
| 386 |
+
"files": [
|
| 387 |
+
f"{cur_dir}/examples/172197131626056_P7966202.png",
|
| 388 |
+
],
|
| 389 |
+
"text": "Why this image funny?",
|
| 390 |
+
},
|
| 391 |
+
],
|
| 392 |
+
[
|
| 393 |
+
{
|
| 394 |
+
"files": [
|
| 395 |
+
f"{cur_dir}/examples/norway.jpg",
|
| 396 |
+
],
|
| 397 |
+
"text": "Analysieren, in welchem Land diese Szene höchstwahrscheinlich gedreht wurde.",
|
| 398 |
+
},
|
| 399 |
+
],
|
| 400 |
+
[
|
| 401 |
+
{
|
| 402 |
+
"files": [
|
| 403 |
+
f"{cur_dir}/examples/totoro.jpg",
|
| 404 |
+
],
|
| 405 |
+
"text": "¿En qué anime aparece esta escena? ¿Puedes presentarlo?",
|
| 406 |
+
},
|
| 407 |
+
],
|
| 408 |
+
[
|
| 409 |
+
{
|
| 410 |
+
"files": [
|
| 411 |
+
f"{cur_dir}/examples/africa.jpg",
|
| 412 |
+
],
|
| 413 |
+
"text": "इस तस्वीर में हर एक दृश्य तत्व का क्या प्रतिनिधित्व करता है?",
|
| 414 |
+
},
|
| 415 |
+
],
|
| 416 |
+
[
|
| 417 |
+
{
|
| 418 |
+
"files": [
|
| 419 |
+
f"{cur_dir}/examples/hot_ballon.jpg",
|
| 420 |
+
],
|
| 421 |
+
"text": "ฉากบอลลูนลมร้อนในภาพนี้อาจอยู่ที่ไหน? สถานที่นี้มีความพิเศษอย่างไร?",
|
| 422 |
+
},
|
| 423 |
+
],
|
| 424 |
+
[
|
| 425 |
+
{
|
| 426 |
+
"files": [
|
| 427 |
+
f"{cur_dir}/examples/bar.jpg",
|
| 428 |
+
],
|
| 429 |
+
"text": "Você pode me dar ideias de design baseadas no tema de coquetéis deste letreiro?",
|
| 430 |
+
},
|
| 431 |
+
],
|
| 432 |
+
[
|
| 433 |
+
{
|
| 434 |
+
"files": [
|
| 435 |
+
f"{cur_dir}/examples/pink_lake.jpg",
|
| 436 |
+
],
|
| 437 |
+
"text": "Обясни защо езерото на този остров е в този цвят.",
|
| 438 |
+
},
|
| 439 |
+
],
|
| 440 |
+
[
|
| 441 |
+
{
|
| 442 |
+
"files": [
|
| 443 |
+
f"{cur_dir}/examples/hanzi.jpg",
|
| 444 |
+
],
|
| 445 |
+
"text": "Can you describe in Hebrew the evolution process of these four Chinese characters from pictographs to modern characters?",
|
| 446 |
+
},
|
| 447 |
+
],
|
| 448 |
+
[
|
| 449 |
+
{
|
| 450 |
+
"files": [
|
| 451 |
+
f"{cur_dir}/examples/ballon.jpg",
|
| 452 |
+
],
|
| 453 |
+
"text": "இந்த காட்சியை விவரிக்கவும், மேலும் இந்த படத்தின் அடிப்படையில் துருக்கியில் இந்த காட்சியுடன் தொடர்பான சில பிரபலமான நிகழ்வுகள் என்ன?",
|
| 454 |
+
},
|
| 455 |
+
],
|
| 456 |
+
[
|
| 457 |
+
{
|
| 458 |
+
"files": [
|
| 459 |
+
f"{cur_dir}/examples/pie.jpg",
|
| 460 |
+
],
|
| 461 |
+
"text": "Décrivez ce graphique. Quelles informations pouvons-nous en tirer?",
|
| 462 |
+
},
|
| 463 |
+
],
|
| 464 |
+
[
|
| 465 |
+
{
|
| 466 |
+
"files": [
|
| 467 |
+
f"{cur_dir}/examples/camera.jpg",
|
| 468 |
+
],
|
| 469 |
+
"text": "Apa arti dari dua angka di sebelah kiri yang ditampilkan di layar kamera?",
|
| 470 |
+
},
|
| 471 |
+
],
|
| 472 |
+
[
|
| 473 |
+
{
|
| 474 |
+
"files": [
|
| 475 |
+
f"{cur_dir}/examples/dog.jpg",
|
| 476 |
+
],
|
| 477 |
+
"text": "이 강아지의 표정을 보고 어떤 기분이나 감정을 느끼고 있는지 설명해 주시겠어요?",
|
| 478 |
+
},
|
| 479 |
+
],
|
| 480 |
+
[
|
| 481 |
+
{
|
| 482 |
+
"files": [
|
| 483 |
+
f"{cur_dir}/examples/book.jpg",
|
| 484 |
+
],
|
| 485 |
+
"text": "What language is the text in, and what does the title mean in English?",
|
| 486 |
+
},
|
| 487 |
+
],
|
| 488 |
+
[
|
| 489 |
+
{
|
| 490 |
+
"files": [
|
| 491 |
+
f"{cur_dir}/examples/food.jpg",
|
| 492 |
+
],
|
| 493 |
+
"text": "Unaweza kunipa kichocheo cha kutengeneza hii pancake?",
|
| 494 |
+
},
|
| 495 |
+
],
|
| 496 |
+
[
|
| 497 |
+
{
|
| 498 |
+
"files": [
|
| 499 |
+
f"{cur_dir}/examples/line chart.jpg",
|
| 500 |
+
],
|
| 501 |
+
"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ừ đó.",
|
| 502 |
+
},
|
| 503 |
+
],
|
| 504 |
+
[
|
| 505 |
+
{
|
| 506 |
+
"files": [
|
| 507 |
+
f"{cur_dir}/examples/south africa.jpg",
|
| 508 |
+
],
|
| 509 |
+
"text": "Waar is hierdie plek? Help my om ’n reisroete vir hierdie land te beplan.",
|
| 510 |
+
},
|
| 511 |
+
],
|
| 512 |
+
[
|
| 513 |
+
{
|
| 514 |
+
"files": [
|
| 515 |
+
f"{cur_dir}/examples/girl.jpg",
|
| 516 |
+
],
|
| 517 |
+
"text": "لماذا هذه الصورة مضحكة؟",
|
| 518 |
+
},
|
| 519 |
+
],
|
| 520 |
+
[
|
| 521 |
+
{
|
| 522 |
+
"files": [
|
| 523 |
+
f"{cur_dir}/examples/eagles.jpg",
|
| 524 |
+
],
|
| 525 |
+
"text": "Какой креатив должен быть в этом логотипе?",
|
| 526 |
+
},
|
| 527 |
+
],
|
| 528 |
],
|
| 529 |
inputs=[chat_input],
|
| 530 |
label="Image",
|