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 {
|
|
@@ -274,7 +274,53 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as app:
|
|
| 274 |
with gr.Row(elem_id="main-container"):
|
| 275 |
with gr.Column():
|
| 276 |
with gr.Tabs():
|
| 277 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 278 |
# Settings Tab
|
| 279 |
with gr.Tab("βοΈ Settings", elem_classes=["tab-nav"]):
|
| 280 |
gr.HTML("""
|
|
@@ -327,7 +373,7 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as app:
|
|
| 327 |
label="π Max Tokens",
|
| 328 |
info="Maximum length of response"
|
| 329 |
)
|
| 330 |
-
|
| 331 |
# Examples Tab
|
| 332 |
with gr.Tab("π Examples & Capabilities", elem_classes=["tab-nav"]):
|
| 333 |
gr.HTML("""
|
|
@@ -379,53 +425,6 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as app:
|
|
| 379 |
</div>
|
| 380 |
""")
|
| 381 |
|
| 382 |
-
# Chat Tab
|
| 383 |
-
with gr.Tab("π¬ Chat Interface", elem_classes=["tab-nav"]):
|
| 384 |
-
gr.HTML("""
|
| 385 |
-
<div class='info-box'>
|
| 386 |
-
<strong>π― What can I do?</strong><br>
|
| 387 |
-
β’ Analyze images, documents, and charts<br>
|
| 388 |
-
β’ Perform OCR and text extraction<br>
|
| 389 |
-
β’ Reason through complex problems<br>
|
| 390 |
-
β’ Answer questions about visual content<br>
|
| 391 |
-
β’ Process multi-image documents
|
| 392 |
-
</div>
|
| 393 |
-
""")
|
| 394 |
-
|
| 395 |
-
chatbot = gr.Chatbot(
|
| 396 |
-
label="Conversation",
|
| 397 |
-
height=500,
|
| 398 |
-
show_copy_button=True,
|
| 399 |
-
avatar_images=(None, "https://www.nvidia.com/favicon.ico"),
|
| 400 |
-
elem_classes=["chatbot"]
|
| 401 |
-
)
|
| 402 |
-
|
| 403 |
-
with gr.Row():
|
| 404 |
-
msg = gr.Textbox(
|
| 405 |
-
label="Your Message",
|
| 406 |
-
placeholder="Ask me anything about images, documents, or reasoning tasks...",
|
| 407 |
-
lines=3,
|
| 408 |
-
scale=4
|
| 409 |
-
)
|
| 410 |
-
|
| 411 |
-
with gr.Row():
|
| 412 |
-
images = gr.File(
|
| 413 |
-
label="π Upload Images/Documents (Multi-image support)",
|
| 414 |
-
file_count="multiple",
|
| 415 |
-
file_types=["image"],
|
| 416 |
-
scale=3
|
| 417 |
-
)
|
| 418 |
-
|
| 419 |
-
with gr.Row():
|
| 420 |
-
submit_btn = gr.Button("π Send", variant="primary", scale=2, elem_classes=["primary"])
|
| 421 |
-
clear_btn = gr.Button("ποΈ Clear", variant="secondary", scale=1, elem_classes=["secondary"])
|
| 422 |
-
|
| 423 |
-
reasoning_display = gr.Textbox(
|
| 424 |
-
label="π§ Reasoning Process (when enabled)",
|
| 425 |
-
lines=6,
|
| 426 |
-
interactive=False
|
| 427 |
-
)
|
| 428 |
-
|
| 429 |
# About Tab
|
| 430 |
with gr.Tab("βΉοΈ About", elem_classes=["tab-nav"]):
|
| 431 |
gr.Markdown("""
|
|
@@ -509,7 +508,7 @@ with gr.Blocks(css=custom_css, theme=gr.themes.Soft()) as app:
|
|
| 509 |
# Launch the app
|
| 510 |
if __name__ == "__main__":
|
| 511 |
app.launch(
|
| 512 |
-
share=
|
| 513 |
server_name="0.0.0.0",
|
| 514 |
server_port=7860,
|
| 515 |
show_error=True
|
|
|
|
| 131 |
}
|
| 132 |
|
| 133 |
.gradio-container {
|
| 134 |
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
|
| 135 |
}
|
| 136 |
|
| 137 |
#main-container {
|
|
|
|
| 274 |
with gr.Row(elem_id="main-container"):
|
| 275 |
with gr.Column():
|
| 276 |
with gr.Tabs():
|
| 277 |
+
# Chat Tab
|
| 278 |
+
with gr.Tab("π¬ Chat Interface", elem_classes=["tab-nav"]):
|
| 279 |
+
gr.HTML("""
|
| 280 |
+
<div class='info-box'>
|
| 281 |
+
<strong>π― What can I do?</strong><br>
|
| 282 |
+
β’ Analyze images, documents, and charts<br>
|
| 283 |
+
β’ Perform OCR and text extraction<br>
|
| 284 |
+
β’ Reason through complex problems<br>
|
| 285 |
+
β’ Answer questions about visual content<br>
|
| 286 |
+
β’ Process multi-image documents
|
| 287 |
+
</div>
|
| 288 |
+
""")
|
| 289 |
+
|
| 290 |
+
chatbot = gr.Chatbot(
|
| 291 |
+
label="Conversation",
|
| 292 |
+
height=500,
|
| 293 |
+
show_copy_button=True,
|
| 294 |
+
avatar_images=(None, "https://www.nvidia.com/favicon.ico"),
|
| 295 |
+
elem_classes=["chatbot"]
|
| 296 |
+
)
|
| 297 |
+
|
| 298 |
+
with gr.Row():
|
| 299 |
+
msg = gr.Textbox(
|
| 300 |
+
label="Your Message",
|
| 301 |
+
placeholder="Ask me anything about images, documents, or reasoning tasks...",
|
| 302 |
+
lines=3,
|
| 303 |
+
scale=4
|
| 304 |
+
)
|
| 305 |
+
|
| 306 |
+
with gr.Row():
|
| 307 |
+
images = gr.File(
|
| 308 |
+
label="π Upload Files (Images, PDFs, Documents - Multi-file support)",
|
| 309 |
+
file_count="multiple",
|
| 310 |
+
file_types=[".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp", ".tiff", ".pdf", ".txt"],
|
| 311 |
+
scale=3
|
| 312 |
+
)
|
| 313 |
+
|
| 314 |
+
with gr.Row():
|
| 315 |
+
submit_btn = gr.Button("π Send", variant="primary", scale=2, elem_classes=["primary"])
|
| 316 |
+
clear_btn = gr.Button("ποΈ Clear", variant="secondary", scale=1, elem_classes=["secondary"])
|
| 317 |
+
|
| 318 |
+
reasoning_display = gr.Textbox(
|
| 319 |
+
label="π§ Reasoning Process (when enabled)",
|
| 320 |
+
lines=6,
|
| 321 |
+
interactive=False
|
| 322 |
+
)
|
| 323 |
+
|
| 324 |
# Settings Tab
|
| 325 |
with gr.Tab("βοΈ Settings", elem_classes=["tab-nav"]):
|
| 326 |
gr.HTML("""
|
|
|
|
| 373 |
label="π Max Tokens",
|
| 374 |
info="Maximum length of response"
|
| 375 |
)
|
| 376 |
+
|
| 377 |
# Examples Tab
|
| 378 |
with gr.Tab("π Examples & Capabilities", elem_classes=["tab-nav"]):
|
| 379 |
gr.HTML("""
|
|
|
|
| 425 |
</div>
|
| 426 |
""")
|
| 427 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 428 |
# About Tab
|
| 429 |
with gr.Tab("βΉοΈ About", elem_classes=["tab-nav"]):
|
| 430 |
gr.Markdown("""
|
|
|
|
| 508 |
# Launch the app
|
| 509 |
if __name__ == "__main__":
|
| 510 |
app.launch(
|
| 511 |
+
share=False,
|
| 512 |
server_name="0.0.0.0",
|
| 513 |
server_port=7860,
|
| 514 |
show_error=True
|