Update app.py
Browse files
app.py
CHANGED
|
@@ -336,22 +336,55 @@ def respond(
|
|
| 336 |
|
| 337 |
|
| 338 |
def create_interface():
|
| 339 |
-
"""Create Gradio interface."""
|
| 340 |
try:
|
| 341 |
import gradio as gr
|
| 342 |
except ImportError:
|
| 343 |
print("[error] gradio not installed. Run: pip install gradio")
|
| 344 |
-
return None
|
| 345 |
|
| 346 |
from gradio import ChatMessage
|
| 347 |
-
# Custom CSS for dark gothic theme
|
| 348 |
custom_css = """
|
| 349 |
.gradio-container {
|
| 350 |
background-color: #0a0a0c !important;
|
| 351 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 352 |
.chatbot .message {
|
| 353 |
font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace !important;
|
| 354 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 355 |
"""
|
| 356 |
|
| 357 |
# ASCII art logo
|
|
@@ -371,7 +404,7 @@ def create_interface():
|
|
| 371 |
**NO SEED FROM PROMPT** — Haze speaks from its internal field, not your input.
|
| 372 |
"""
|
| 373 |
|
| 374 |
-
with gr.Blocks(
|
| 375 |
gr.Markdown(logo)
|
| 376 |
|
| 377 |
with gr.Row():
|
|
@@ -442,7 +475,7 @@ def create_interface():
|
|
| 442 |
*Co-authored by Claude (GitHub Copilot Coding Agent), January 2026*
|
| 443 |
""")
|
| 444 |
|
| 445 |
-
return demo
|
| 446 |
|
| 447 |
|
| 448 |
# ============================================================================
|
|
@@ -459,12 +492,14 @@ def main():
|
|
| 459 |
print("=" * 60)
|
| 460 |
print()
|
| 461 |
|
| 462 |
-
|
| 463 |
|
| 464 |
-
if
|
| 465 |
print("[error] Could not create interface")
|
| 466 |
return
|
| 467 |
|
|
|
|
|
|
|
| 468 |
print("Starting Gradio server...")
|
| 469 |
print()
|
| 470 |
|
|
@@ -474,6 +509,8 @@ def main():
|
|
| 474 |
server_port=7860,
|
| 475 |
share=False,
|
| 476 |
show_error=True,
|
|
|
|
|
|
|
| 477 |
)
|
| 478 |
|
| 479 |
|
|
|
|
| 336 |
|
| 337 |
|
| 338 |
def create_interface():
|
| 339 |
+
"""Create and return Gradio interface with custom CSS and title."""
|
| 340 |
try:
|
| 341 |
import gradio as gr
|
| 342 |
except ImportError:
|
| 343 |
print("[error] gradio not installed. Run: pip install gradio")
|
| 344 |
+
return None, None, None
|
| 345 |
|
| 346 |
from gradio import ChatMessage
|
| 347 |
+
# Custom CSS for dark gothic theme with improved readability
|
| 348 |
custom_css = """
|
| 349 |
.gradio-container {
|
| 350 |
background-color: #0a0a0c !important;
|
| 351 |
}
|
| 352 |
+
|
| 353 |
+
.chatbot .message.user {
|
| 354 |
+
background-color: #1a1a1f !important;
|
| 355 |
+
color: #ffffff !important;
|
| 356 |
+
}
|
| 357 |
+
|
| 358 |
+
.chatbot .message.assistant {
|
| 359 |
+
background-color: #2a2a2f !important;
|
| 360 |
+
color: #ffb347 !important;
|
| 361 |
+
}
|
| 362 |
+
|
| 363 |
.chatbot .message {
|
| 364 |
font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace !important;
|
| 365 |
}
|
| 366 |
+
|
| 367 |
+
/* Improved visibility for sidebar text */
|
| 368 |
+
.markdown h3, .markdown h2 {
|
| 369 |
+
color: #ffb347 !important;
|
| 370 |
+
font-weight: bold !important;
|
| 371 |
+
}
|
| 372 |
+
|
| 373 |
+
.markdown p {
|
| 374 |
+
color: #e0e0e0 !important;
|
| 375 |
+
font-size: 14px !important;
|
| 376 |
+
}
|
| 377 |
+
|
| 378 |
+
.markdown ul, .markdown li {
|
| 379 |
+
color: #d4d4d4 !important;
|
| 380 |
+
font-size: 13px !important;
|
| 381 |
+
}
|
| 382 |
+
|
| 383 |
+
/* Ensure code blocks are visible */
|
| 384 |
+
code {
|
| 385 |
+
color: #ff6b6b !important;
|
| 386 |
+
background-color: #1a1a2e !important;
|
| 387 |
+
}
|
| 388 |
"""
|
| 389 |
|
| 390 |
# ASCII art logo
|
|
|
|
| 404 |
**NO SEED FROM PROMPT** — Haze speaks from its internal field, not your input.
|
| 405 |
"""
|
| 406 |
|
| 407 |
+
with gr.Blocks() as demo:
|
| 408 |
gr.Markdown(logo)
|
| 409 |
|
| 410 |
with gr.Row():
|
|
|
|
| 475 |
*Co-authored by Claude (GitHub Copilot Coding Agent), January 2026*
|
| 476 |
""")
|
| 477 |
|
| 478 |
+
return demo, custom_css, "HAZE + CLOUD"
|
| 479 |
|
| 480 |
|
| 481 |
# ============================================================================
|
|
|
|
| 492 |
print("=" * 60)
|
| 493 |
print()
|
| 494 |
|
| 495 |
+
result = create_interface()
|
| 496 |
|
| 497 |
+
if result is None or result[0] is None:
|
| 498 |
print("[error] Could not create interface")
|
| 499 |
return
|
| 500 |
|
| 501 |
+
demo, custom_css, title = result
|
| 502 |
+
|
| 503 |
print("Starting Gradio server...")
|
| 504 |
print()
|
| 505 |
|
|
|
|
| 509 |
server_port=7860,
|
| 510 |
share=False,
|
| 511 |
show_error=True,
|
| 512 |
+
css=custom_css,
|
| 513 |
+
title=title,
|
| 514 |
)
|
| 515 |
|
| 516 |
|