Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -131,7 +131,7 @@ custom_css = """
|
|
| 131 |
}
|
| 132 |
|
| 133 |
.gradio-container {
|
| 134 |
-
background: linear-gradient(135deg,
|
| 135 |
}
|
| 136 |
|
| 137 |
#main-container {
|
|
@@ -143,7 +143,7 @@ custom_css = """
|
|
| 143 |
}
|
| 144 |
|
| 145 |
.header-title {
|
| 146 |
-
background: linear-gradient(135deg,
|
| 147 |
-webkit-background-clip: text;
|
| 148 |
-webkit-text-fill-color: transparent;
|
| 149 |
font-size: 3em;
|
|
@@ -374,6 +374,180 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as app:
|
|
| 374 |
info="Maximum length of response"
|
| 375 |
)
|
| 376 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 377 |
# Examples Tab
|
| 378 |
with gr.Tab("π Examples & Capabilities", elem_classes=["tab-nav"]):
|
| 379 |
gr.HTML("""
|
|
@@ -508,8 +682,8 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as app:
|
|
| 508 |
# Launch the app
|
| 509 |
if __name__ == "__main__":
|
| 510 |
app.launch(
|
| 511 |
-
share=
|
| 512 |
-
server_name="0.0.0.0",
|
| 513 |
-
server_port=7860,
|
| 514 |
-
show_error=True
|
| 515 |
)
|
|
|
|
| 131 |
}
|
| 132 |
|
| 133 |
.gradio-container {
|
| 134 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
|
| 135 |
}
|
| 136 |
|
| 137 |
#main-container {
|
|
|
|
| 143 |
}
|
| 144 |
|
| 145 |
.header-title {
|
| 146 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
| 147 |
-webkit-background-clip: text;
|
| 148 |
-webkit-text-fill-color: transparent;
|
| 149 |
font-size: 3em;
|
|
|
|
| 374 |
info="Maximum length of response"
|
| 375 |
)
|
| 376 |
|
| 377 |
+
# File Support Tab
|
| 378 |
+
with gr.Tab("π Supported Files", elem_classes=["tab-nav"]):
|
| 379 |
+
gr.HTML("""
|
| 380 |
+
<div style='text-align: center; margin-bottom: 30px;'>
|
| 381 |
+
<h2 style='color: #667eea; font-size: 2em; margin-bottom: 10px;'>π Supported File Types</h2>
|
| 382 |
+
<p style='color: #666; font-size: 1.1em;'>Nemotron Nano 2 VL accepts a wide variety of file formats</p>
|
| 383 |
+
</div>
|
| 384 |
+
|
| 385 |
+
<div class='capability-card' style='background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);'>
|
| 386 |
+
<h3 style='color: #667eea; display: flex; align-items: center; gap: 10px;'>
|
| 387 |
+
πΌοΈ Image Files
|
| 388 |
+
</h3>
|
| 389 |
+
<div style='display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-top: 15px;'>
|
| 390 |
+
<div style='background: white; padding: 15px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);'>
|
| 391 |
+
<strong style='color: #667eea;'>π· JPEG/JPG</strong>
|
| 392 |
+
<p style='margin: 5px 0 0 0; color: #666; font-size: 0.9em;'>Standard photo format</p>
|
| 393 |
+
</div>
|
| 394 |
+
<div style='background: white; padding: 15px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);'>
|
| 395 |
+
<strong style='color: #667eea;'>π¨ PNG</strong>
|
| 396 |
+
<p style='margin: 5px 0 0 0; color: #666; font-size: 0.9em;'>Lossless with transparency</p>
|
| 397 |
+
</div>
|
| 398 |
+
<div style='background: white; padding: 15px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);'>
|
| 399 |
+
<strong style='color: #667eea;'>π¬ GIF</strong>
|
| 400 |
+
<p style='margin: 5px 0 0 0; color: #666; font-size: 0.9em;'>Animated images</p>
|
| 401 |
+
</div>
|
| 402 |
+
<div style='background: white; padding: 15px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);'>
|
| 403 |
+
<strong style='color: #667eea;'>π WebP</strong>
|
| 404 |
+
<p style='margin: 5px 0 0 0; color: #666; font-size: 0.9em;'>Modern web format</p>
|
| 405 |
+
</div>
|
| 406 |
+
<div style='background: white; padding: 15px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);'>
|
| 407 |
+
<strong style='color: #667eea;'>πΌοΈ BMP</strong>
|
| 408 |
+
<p style='margin: 5px 0 0 0; color: #666; font-size: 0.9em;'>Bitmap images</p>
|
| 409 |
+
</div>
|
| 410 |
+
<div style='background: white; padding: 15px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);'>
|
| 411 |
+
<strong style='color: #667eea;'>π TIFF</strong>
|
| 412 |
+
<p style='margin: 5px 0 0 0; color: #666; font-size: 0.9em;'>High-quality scans</p>
|
| 413 |
+
</div>
|
| 414 |
+
</div>
|
| 415 |
+
</div>
|
| 416 |
+
|
| 417 |
+
<div class='capability-card' style='background: linear-gradient(135deg, #fff3e0 0%, #fce4ec 100%); margin-top: 20px;'>
|
| 418 |
+
<h3 style='color: #f57c00; display: flex; align-items: center; gap: 10px;'>
|
| 419 |
+
π Document Files
|
| 420 |
+
</h3>
|
| 421 |
+
<div style='display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; margin-top: 15px;'>
|
| 422 |
+
<div style='background: white; padding: 20px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);'>
|
| 423 |
+
<strong style='color: #f57c00; font-size: 1.1em;'>π PDF Documents</strong>
|
| 424 |
+
<p style='margin: 10px 0 0 0; color: #666; line-height: 1.6;'>
|
| 425 |
+
β’ Multi-page support<br>
|
| 426 |
+
β’ Text extraction<br>
|
| 427 |
+
β’ Layout analysis<br>
|
| 428 |
+
β’ Scanned documents<br>
|
| 429 |
+
β’ Forms and tables
|
| 430 |
+
</p>
|
| 431 |
+
</div>
|
| 432 |
+
<div style='background: white; padding: 20px; border-radius: 10px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);'>
|
| 433 |
+
<strong style='color: #f57c00; font-size: 1.1em;'>π Text Files (.txt)</strong>
|
| 434 |
+
<p style='margin: 10px 0 0 0; color: #666; line-height: 1.6;'>
|
| 435 |
+
β’ Plain text documents<br>
|
| 436 |
+
β’ Code snippets<br>
|
| 437 |
+
β’ Notes and logs<br>
|
| 438 |
+
β’ Data files<br>
|
| 439 |
+
β’ Configuration files
|
| 440 |
+
</p>
|
| 441 |
+
</div>
|
| 442 |
+
</div>
|
| 443 |
+
</div>
|
| 444 |
+
|
| 445 |
+
<div style='margin-top: 30px; text-align: center;'>
|
| 446 |
+
<h2 style='color: #667eea; font-size: 2em; margin-bottom: 20px;'>π― What the Model Excels At</h2>
|
| 447 |
+
</div>
|
| 448 |
+
|
| 449 |
+
<div class='capability-card' style='background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);'>
|
| 450 |
+
<h3 style='color: #2e7d32;'>π 1. Document Intelligence</h3>
|
| 451 |
+
<div style='background: white; padding: 20px; border-radius: 10px; margin-top: 15px;'>
|
| 452 |
+
<ul style='color: #666; line-height: 2; margin: 0; padding-left: 20px;'>
|
| 453 |
+
<li><strong>Multi-page PDF analysis</strong> - Process entire documents at once</li>
|
| 454 |
+
<li><strong>Scanned documents</strong> - Extract text from scans and photos of documents</li>
|
| 455 |
+
<li><strong>Forms and tables</strong> - Understand structured data layouts</li>
|
| 456 |
+
<li><strong>Financial reports</strong> - Parse complex financial documents</li>
|
| 457 |
+
<li><strong>Receipts and invoices</strong> - Extract itemized information</li>
|
| 458 |
+
<li><strong>Academic papers</strong> - Understand scientific content and citations</li>
|
| 459 |
+
</ul>
|
| 460 |
+
</div>
|
| 461 |
+
</div>
|
| 462 |
+
|
| 463 |
+
<div class='capability-card' style='background: linear-gradient(135deg, #fff9c4 0%, #fff3e0 100%);'>
|
| 464 |
+
<h3 style='color: #f57f17;'>π€ 2. OCR Excellence (Optical Character Recognition)</h3>
|
| 465 |
+
<div style='background: white; padding: 20px; border-radius: 10px; margin-top: 15px;'>
|
| 466 |
+
<ul style='color: #666; line-height: 2; margin: 0; padding-left: 20px;'>
|
| 467 |
+
<li><strong>Handwritten text</strong> - Recognize cursive and printed handwriting</li>
|
| 468 |
+
<li><strong>Printed text</strong> - Extract text from any printed material</li>
|
| 469 |
+
<li><strong>Text in images</strong> - Find and read text embedded in photos</li>
|
| 470 |
+
<li><strong>Multi-language support</strong> - Handle various languages and scripts</li>
|
| 471 |
+
<li><strong>Low-quality images</strong> - Work with blurry or low-resolution scans</li>
|
| 472 |
+
<li><strong>Complex layouts</strong> - Handle multi-column and mixed layouts</li>
|
| 473 |
+
</ul>
|
| 474 |
+
</div>
|
| 475 |
+
</div>
|
| 476 |
+
|
| 477 |
+
<div class='capability-card' style='background: linear-gradient(135deg, #e1bee7 0%, #f3e5f5 100%);'>
|
| 478 |
+
<h3 style='color: #6a1b9a;'>π 3. Chart & Graph Analysis</h3>
|
| 479 |
+
<div style='background: white; padding: 20px; border-radius: 10px; margin-top: 15px;'>
|
| 480 |
+
<ul style='color: #666; line-height: 2; margin: 0; padding-left: 20px;'>
|
| 481 |
+
<li><strong>Bar charts</strong> - Interpret categorical data comparisons</li>
|
| 482 |
+
<li><strong>Line graphs</strong> - Analyze trends over time</li>
|
| 483 |
+
<li><strong>Pie charts</strong> - Understand proportional distributions</li>
|
| 484 |
+
<li><strong>Scatter plots</strong> - Identify correlations and patterns</li>
|
| 485 |
+
<li><strong>Complex visualizations</strong> - Parse multi-axis and combined charts</li>
|
| 486 |
+
<li><strong>Infographics</strong> - Extract insights from visual data stories</li>
|
| 487 |
+
</ul>
|
| 488 |
+
</div>
|
| 489 |
+
</div>
|
| 490 |
+
|
| 491 |
+
<div class='capability-card' style='background: linear-gradient(135deg, #b3e5fc 0%, #e1f5fe 100%);'>
|
| 492 |
+
<h3 style='color: #01579b;'>π¬ 4. Video Understanding (Frame-by-Frame)</h3>
|
| 493 |
+
<div style='background: white; padding: 20px; border-radius: 10px; margin-top: 15px;'>
|
| 494 |
+
<ul style='color: #666; line-height: 2; margin: 0; padding-left: 20px;'>
|
| 495 |
+
<li><strong>Sequential frames</strong> - Upload multiple frames from videos</li>
|
| 496 |
+
<li><strong>Action recognition</strong> - Understand what's happening across frames</li>
|
| 497 |
+
<li><strong>Temporal analysis</strong> - Track changes over time</li>
|
| 498 |
+
<li><strong>Scene understanding</strong> - Comprehend context and setting</li>
|
| 499 |
+
<li><strong>Object tracking</strong> - Follow objects across frames</li>
|
| 500 |
+
<li><strong>Event detection</strong> - Identify key moments in sequences</li>
|
| 501 |
+
</ul>
|
| 502 |
+
</div>
|
| 503 |
+
</div>
|
| 504 |
+
|
| 505 |
+
<div class='capability-card' style='background: linear-gradient(135deg, #ffccbc 0%, #ffe0b2 100%);'>
|
| 506 |
+
<h3 style='color: #bf360c;'>π 5. Multi-Image Document Processing</h3>
|
| 507 |
+
<div style='background: white; padding: 20px; border-radius: 10px; margin-top: 15px;'>
|
| 508 |
+
<ul style='color: #666; line-height: 2; margin: 0; padding-left: 20px;'>
|
| 509 |
+
<li><strong>Multiple pages at once</strong> - Upload and analyze entire documents</li>
|
| 510 |
+
<li><strong>Cross-reference</strong> - Connect information across different images</li>
|
| 511 |
+
<li><strong>Document comparison</strong> - Compare versions or similar documents</li>
|
| 512 |
+
<li><strong>Batch processing</strong> - Handle multiple documents simultaneously</li>
|
| 513 |
+
<li><strong>Presentation slides</strong> - Understand slide decks and flow</li>
|
| 514 |
+
<li><strong>Comic books/Manga</strong> - Follow visual narratives</li>
|
| 515 |
+
</ul>
|
| 516 |
+
</div>
|
| 517 |
+
</div>
|
| 518 |
+
|
| 519 |
+
<div class='capability-card' style='background: linear-gradient(135deg, #c5e1a5 0%, #dcedc8 100%);'>
|
| 520 |
+
<h3 style='color: #33691e;'>π§ 6. Advanced Reasoning</h3>
|
| 521 |
+
<div style='background: white; padding: 20px; border-radius: 10px; margin-top: 15px;'>
|
| 522 |
+
<ul style='color: #666; line-height: 2; margin: 0; padding-left: 20px;'>
|
| 523 |
+
<li><strong>Step-by-step thinking</strong> - See the model's reasoning process</li>
|
| 524 |
+
<li><strong>Mathematical problems</strong> - Solve complex math with visual elements</li>
|
| 525 |
+
<li><strong>Logical deduction</strong> - Draw conclusions from visual evidence</li>
|
| 526 |
+
<li><strong>Problem decomposition</strong> - Break down complex questions</li>
|
| 527 |
+
<li><strong>Visual reasoning</strong> - Understand spatial and logical relationships</li>
|
| 528 |
+
<li><strong>Transparent thinking</strong> - Explain how conclusions are reached</li>
|
| 529 |
+
</ul>
|
| 530 |
+
</div>
|
| 531 |
+
</div>
|
| 532 |
+
|
| 533 |
+
<div class='success-box' style='margin-top: 30px; font-size: 1.05em;'>
|
| 534 |
+
<strong>π‘ Pro Tips for Best Results:</strong><br><br>
|
| 535 |
+
β
<strong>High-quality images</strong> - Use clear, well-lit photos for better OCR<br>
|
| 536 |
+
β
<strong>Multiple angles</strong> - Upload different views for complex objects<br>
|
| 537 |
+
β
<strong>Specific questions</strong> - Ask targeted questions for precise answers<br>
|
| 538 |
+
β
<strong>Enable reasoning</strong> - Turn on reasoning mode for complex analysis<br>
|
| 539 |
+
β
<strong>Sequential order</strong> - Upload video frames in chronological order<br>
|
| 540 |
+
β
<strong>Context matters</strong> - Provide background information for better understanding
|
| 541 |
+
</div>
|
| 542 |
+
|
| 543 |
+
<div style='background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 25px; border-radius: 16px; text-align: center; margin-top: 30px;'>
|
| 544 |
+
<h3 style='margin: 0 0 10px 0; font-size: 1.5em;'>π Ready to Get Started?</h3>
|
| 545 |
+
<p style='margin: 0; font-size: 1.1em; opacity: 0.95;'>
|
| 546 |
+
Upload your files in the Chat Interface tab and experience the power of Nemotron Nano 2 VL!
|
| 547 |
+
</p>
|
| 548 |
+
</div>
|
| 549 |
+
""")
|
| 550 |
+
|
| 551 |
# Examples Tab
|
| 552 |
with gr.Tab("π Examples & Capabilities", elem_classes=["tab-nav"]):
|
| 553 |
gr.HTML("""
|
|
|
|
| 682 |
# Launch the app
|
| 683 |
if __name__ == "__main__":
|
| 684 |
app.launch(
|
| 685 |
+
share=True,
|
| 686 |
+
# server_name="0.0.0.0",
|
| 687 |
+
# server_port=7860,
|
| 688 |
+
# show_error=True
|
| 689 |
)
|