Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -396,62 +396,184 @@ def ui_upload_memories_action_fn(uploaded_file_obj, progress=gr.Progress()):
|
|
396 |
msg = f"Memories Upload: Processed {total_to_process}. Added: {added_count}, Format Errors: {format_error_count}, Save Errors: {save_error_count}."
|
397 |
logger.info(msg); return msg
|
398 |
|
|
|
|
|
|
|
399 |
custom_theme = gr.themes.Base(primary_hue="teal", secondary_hue="purple", neutral_hue="zinc", text_size="sm", spacing_size="md", radius_size="sm", font=["System UI", "sans-serif"])
|
400 |
custom_css = """
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
408 |
.gr-file > .label-text { color: #bdc3c7 !important;}
|
409 |
.gr-textarea textarea, .gr-textbox input { color: #ecf0f1 !important; }
|
|
|
410 |
.gr-button.gr-button-primary { background-color: #1abc9c !important; color: white !important; border-color: #16a085 !important; }
|
411 |
.gr-button.gr-button-secondary { background-color: #9b59b6 !important; color: white !important; border-color: #8e44ad !important; }
|
412 |
.gr-button.gr-button-stop { background-color: #e74c3c !important; color: white !important; border-color: #c0392b !important; }
|
413 |
-
|
414 |
-
.gr-markdown
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
415 |
.gr-markdown p, .gr-markdown li { color: #ecf0f1 !important; }
|
416 |
-
.gr-markdown pre code {
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
421 |
.gr-info { color: #bdc3c7 !important; font-size: 0.85rem !important; }
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
426 |
"""
|
427 |
|
428 |
-
|
429 |
-
|
|
|
|
|
430 |
|
431 |
avail_provs = get_available_providers()
|
432 |
def_prov = avail_provs[0] if avail_provs else None
|
433 |
def_models = get_model_display_names_for_provider(def_prov) if def_prov else []
|
434 |
def_model_disp = get_default_model_display_name_for_provider(def_prov) if def_prov else None
|
435 |
|
436 |
-
|
|
|
437 |
with gr.Column(scale=3): agent_stat_tb = gr.Textbox(label="Agent Status", interactive=False, lines=1, value="Initializing systems...")
|
438 |
with gr.Column(scale=1): memory_backend_info_tb = gr.Textbox(label="Memory Backend", value=f"{MEMORY_STORAGE_BACKEND}", interactive=False)
|
439 |
if MEMORY_STORAGE_BACKEND == "SQLITE":
|
440 |
-
with gr.Column(scale=2): gr.Textbox(label="SQLite Path", value=f"{MEMORY_SQLITE_PATH}", interactive=False)
|
441 |
elif MEMORY_STORAGE_BACKEND == "HF_DATASET":
|
442 |
-
with gr.Column(scale=2): gr.Textbox(label="HF Repos", value=f"M: {MEMORY_HF_MEM_REPO}, R: {MEMORY_HF_RULES_REPO}", interactive=False)
|
443 |
|
444 |
with gr.Tabs() as main_tabs:
|
445 |
-
with gr.TabItem("βοΈ
|
446 |
-
with gr.Row(equal_height=False):
|
447 |
with gr.Column(scale=1, min_width=380): # Sidebar for config
|
448 |
gr.Markdown("## βοΈ LLM Configuration")
|
449 |
-
with gr.Group():
|
450 |
prov_sel_dd = gr.Dropdown(label="AI Provider", choices=avail_provs, value=def_prov, interactive=True)
|
451 |
model_sel_dd = gr.Dropdown(label="AI Model", choices=def_models, value=def_model_disp, interactive=True)
|
452 |
api_key_tb = gr.Textbox(label="API Key Override (Optional)", type="password", placeholder="Paste key for selected provider")
|
453 |
with gr.Group():
|
454 |
-
sys_prompt_tb = gr.Textbox(label="System Prompt Base", lines=
|
455 |
|
456 |
with gr.Column(scale=2): # Main chat area
|
457 |
gr.Markdown("## π¬ AI Chat Interface")
|
@@ -460,33 +582,36 @@ with gr.Blocks(theme=custom_theme, css=custom_css, title="AI Research Mega Agent
|
|
460 |
user_msg_tb = gr.Textbox(show_label=False, placeholder="Ask your research question or give an instruction...", scale=7, lines=1, max_lines=5, autofocus=True)
|
461 |
send_btn = gr.Button("Send", variant="primary", scale=1, min_width=100)
|
462 |
|
463 |
-
with gr.Accordion("π Full Response / Output Details", open=False
|
464 |
fmt_report_tb = gr.Textbox(label="Full AI Response", lines=10, interactive=True, show_copy_button=True, value="*AI responses will appear here...*")
|
465 |
dl_report_btn = gr.DownloadButton("Download Report", interactive=False, visible=False)
|
466 |
detect_out_md = gr.Markdown("*Insights used or other intermediate details will show here...*")
|
467 |
|
468 |
with gr.TabItem("π§ Knowledge Base Management", id=1):
|
469 |
-
gr.Markdown("## Manage Stored Knowledge")
|
470 |
with gr.Row(equal_height=False):
|
471 |
with gr.Column(scale=1):
|
472 |
-
gr.
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
|
|
481 |
|
482 |
with gr.Column(scale=1):
|
483 |
-
gr.
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
|
|
489 |
|
|
|
490 |
def dyn_upd_model_dd(sel_prov_dyn:str): models_dyn, def_model_dyn = get_model_display_names_for_provider(sel_prov_dyn), get_default_model_display_name_for_provider(sel_prov_dyn); return gr.Dropdown(choices=models_dyn, value=def_model_dyn, interactive=True)
|
491 |
prov_sel_dd.change(fn=dyn_upd_model_dd, inputs=prov_sel_dd, outputs=model_sel_dd)
|
492 |
chat_ins = [user_msg_tb, main_chat_disp, prov_sel_dd, model_sel_dd, api_key_tb, sys_prompt_tb]
|
@@ -532,10 +657,11 @@ with gr.Blocks(theme=custom_theme, css=custom_css, title="AI Research Mega Agent
|
|
532 |
|
533 |
demo.load(fn=app_load_fn, inputs=None, outputs=[agent_stat_tb, rules_disp_ta, mems_disp_json])
|
534 |
|
|
|
535 |
if __name__ == "__main__":
|
536 |
-
logger.info(f"Starting Gradio AI Research Mega Agent (v5.
|
537 |
app_port, app_server = int(os.getenv("GRADIO_PORT", 7860)), os.getenv("GRADIO_SERVER_NAME", "127.0.0.1")
|
538 |
app_debug, app_share = os.getenv("GRADIO_DEBUG", "False").lower()=="true", os.getenv("GRADIO_SHARE", "False").lower()=="true"
|
539 |
logger.info(f"Launching Gradio server: http://{app_server}:{app_port}. Debug: {app_debug}, Share: {app_share}")
|
540 |
-
demo.queue().launch(server_name=app_server, server_port=app_port, debug=app_debug, share=app_share)
|
541 |
logger.info("Gradio application shut down.")
|
|
|
396 |
msg = f"Memories Upload: Processed {total_to_process}. Added: {added_count}, Format Errors: {format_error_count}, Save Errors: {save_error_count}."
|
397 |
logger.info(msg); return msg
|
398 |
|
399 |
+
# app.py
|
400 |
+
# ... (all other Python code remains the same) ...
|
401 |
+
|
402 |
custom_theme = gr.themes.Base(primary_hue="teal", secondary_hue="purple", neutral_hue="zinc", text_size="sm", spacing_size="md", radius_size="sm", font=["System UI", "sans-serif"])
|
403 |
custom_css = """
|
404 |
+
html, body { /* Reset browser defaults for html and body */
|
405 |
+
margin: 0 !important;
|
406 |
+
padding: 0 !important;
|
407 |
+
height: 100%; /* Ensure body can fill height if needed */
|
408 |
+
box-sizing: border-box; /* Better box model */
|
409 |
+
}
|
410 |
+
*, *:before, *:after { /* Apply box-sizing to all elements */
|
411 |
+
box-sizing: inherit;
|
412 |
+
}
|
413 |
+
|
414 |
+
body {
|
415 |
+
background: linear-gradient(to bottom right, #2c3e50, #34495e);
|
416 |
+
color: #ecf0f1;
|
417 |
+
min-height: 100vh; /* Ensure body takes at least full viewport height */
|
418 |
+
font-family: 'Inter', sans-serif; /* Moved font-family here for global effect */
|
419 |
+
}
|
420 |
+
|
421 |
+
.gradio-container {
|
422 |
+
background: transparent !important;
|
423 |
+
max-width: 100% !important; /* Use 100% to avoid slight gaps on sides sometimes seen with 98/96% */
|
424 |
+
padding: 1rem !important; /* Ensure some padding around the content */
|
425 |
+
margin: 0 auto !important; /* Center if max-width was less than 100% */
|
426 |
+
min-height: 100vh; /* Make container also try to fill height */
|
427 |
+
display: flex; /* Helps with some layout consistencies */
|
428 |
+
flex-direction: column; /* Stack children vertically */
|
429 |
+
}
|
430 |
+
|
431 |
+
/* Target the very first direct child block of gradio-container to remove top margin if any */
|
432 |
+
.gradio-container > .gr-block:first-child {
|
433 |
+
margin-top: 0 !important;
|
434 |
+
}
|
435 |
+
|
436 |
+
/* Target the main title markdown specifically if it's causing issues */
|
437 |
+
.gradio-container > .gr-block.gr-markdown:first-child h1:first-child {
|
438 |
+
margin-top: 0 !important;
|
439 |
+
padding-top: 0 !important; /* Also try padding */
|
440 |
+
}
|
441 |
+
|
442 |
+
|
443 |
+
.gr-box, .gr-panel, .gr-tabs, .gr-accordion {
|
444 |
+
background-color: rgba(44, 62, 80, 0.85) !important;
|
445 |
+
border: 1px solid rgba(189, 195, 199, 0.2) !important;
|
446 |
+
border-radius: 8px !important;
|
447 |
+
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
|
448 |
+
}
|
449 |
+
.gr-tabitem {
|
450 |
+
background-color: rgba(52, 73, 94, 0.7) !important;
|
451 |
+
border-radius: 6px !important;
|
452 |
+
margin-bottom: 5px !important;
|
453 |
+
padding: 1em !important;
|
454 |
+
}
|
455 |
+
|
456 |
+
.gr-textbox, .gr-dropdown, .gr-button, .gr-code, .gr-chat-message, .gr-json, .gr-file input[type="file"] {
|
457 |
+
border: 1px solid rgba(189, 195, 199, 0.3) !important;
|
458 |
+
background-color: rgba(52, 73, 94, 0.9) !important;
|
459 |
+
color: #ecf0f1 !important;
|
460 |
+
border-radius: 6px !important;
|
461 |
+
}
|
462 |
+
.gr-file {
|
463 |
+
background-color: rgba(52, 73, 94, 0.9) !important;
|
464 |
+
border-radius: 6px !important; padding: 0.5em;
|
465 |
+
}
|
466 |
.gr-file > .label-text { color: #bdc3c7 !important;}
|
467 |
.gr-textarea textarea, .gr-textbox input { color: #ecf0f1 !important; }
|
468 |
+
|
469 |
.gr-button.gr-button-primary { background-color: #1abc9c !important; color: white !important; border-color: #16a085 !important; }
|
470 |
.gr-button.gr-button-secondary { background-color: #9b59b6 !important; color: white !important; border-color: #8e44ad !important; }
|
471 |
.gr-button.gr-button-stop { background-color: #e74c3c !important; color: white !important; border-color: #c0392b !important; }
|
472 |
+
|
473 |
+
.gr-markdown { background-color: transparent !important; padding: 0px; } /* Make markdown itself transparent if inside a styled box */
|
474 |
+
.gr-markdown h1, .gr-markdown h2, .gr-markdown h3 {
|
475 |
+
color: #1abc9c !important;
|
476 |
+
border-bottom: 1px solid rgba(189, 195, 199, 0.2) !important;
|
477 |
+
padding-bottom: 0.3em;
|
478 |
+
margin-top: 0.8em; /* Adjust default top margin for headers within markdown */
|
479 |
+
margin-bottom: 0.5em;
|
480 |
+
}
|
481 |
.gr-markdown p, .gr-markdown li { color: #ecf0f1 !important; }
|
482 |
+
.gr-markdown pre code {
|
483 |
+
background-color: rgba(30, 40, 50, 0.95) !important;
|
484 |
+
border: 1px solid rgba(189, 195, 199, 0.3) !important;
|
485 |
+
color: #ecf0f1;
|
486 |
+
border-radius: 4px; padding: 0.8em;
|
487 |
+
}
|
488 |
+
|
489 |
+
.gr-chatbot {
|
490 |
+
background-color: rgba(44, 62, 80, 0.7) !important;
|
491 |
+
border: 1px solid rgba(189, 195, 199, 0.2) !important;
|
492 |
+
}
|
493 |
+
.gr-chatbot .message {
|
494 |
+
background-color: rgba(52, 73, 94, 0.9) !important;
|
495 |
+
color: #ecf0f1 !important;
|
496 |
+
border: 1px solid rgba(189, 195, 199, 0.2) !important;
|
497 |
+
box-shadow: 0 1px 2px rgba(0,0,0,0.1) !important;
|
498 |
+
}
|
499 |
+
.gr-chatbot .message.user {
|
500 |
+
background-color: rgba(46, 204, 113, 0.8) !important;
|
501 |
+
color: #2c3e50 !important;
|
502 |
+
}
|
503 |
+
|
504 |
+
.gr-input-label > .label-text, .gr-dropdown-label > .label-text, .gr-checkbox-label > .label-text {
|
505 |
+
color: #bdc3c7 !important;
|
506 |
+
font-size: 0.9rem !important;
|
507 |
+
}
|
508 |
.gr-info { color: #bdc3c7 !important; font-size: 0.85rem !important; }
|
509 |
+
|
510 |
+
#status_bar_group { /* Renamed from elem_id to elem_classes if Gradio prefers that for styling groups */
|
511 |
+
background-color: rgba(44, 62, 80, 0.8) !important;
|
512 |
+
padding: 8px;
|
513 |
+
border-radius: 6px;
|
514 |
+
margin-bottom: 10px;
|
515 |
+
}
|
516 |
+
/* If using elem_classes="status-bar-group" on the gr.Row instead of elem_id */
|
517 |
+
.status-bar-group {
|
518 |
+
background-color: rgba(44, 62, 80, 0.8) !important;
|
519 |
+
padding: 8px;
|
520 |
+
border-radius: 6px;
|
521 |
+
margin-bottom: 10px;
|
522 |
+
}
|
523 |
+
|
524 |
+
|
525 |
+
.tabnav button { /* Style for tab buttons */
|
526 |
+
background-color: rgba(52, 73, 94, 0.8) !important;
|
527 |
+
color: #ecf0f1 !important;
|
528 |
+
border-bottom: 2px solid transparent !important;
|
529 |
+
border-top-left-radius: 6px !important; /* Slightly rounded top corners */
|
530 |
+
border-top-right-radius: 6px !important;
|
531 |
+
margin-right: 2px !important; /* Small gap between tab buttons */
|
532 |
+
}
|
533 |
+
.tabnav button.selected {
|
534 |
+
background-color: rgba(44, 62, 80, 0.95) !important; /* Match tab content background */
|
535 |
+
color: #1abc9c !important;
|
536 |
+
border-bottom: 2px solid #1abc9c !important;
|
537 |
+
}
|
538 |
+
|
539 |
+
.gr-block.gr-box { padding: 1em; } /* General padding for groups/boxes */
|
540 |
+
|
541 |
+
/* Ensure the main title Markdown doesn't have excessive top margin */
|
542 |
+
.gradio-container > .gr-block.gr-markdown:first-of-type h1 {
|
543 |
+
margin-top: 0 !important; /* This is more specific */
|
544 |
+
}
|
545 |
"""
|
546 |
|
547 |
+
|
548 |
+
|
549 |
+
with gr.Blocks(theme=custom_theme, css=custom_css, title="AI Research Mega Agent v5.3") as demo:
|
550 |
+
gr.Markdown("# π AI Research Mega Agent Dashboard") # This is the first visible element
|
551 |
|
552 |
avail_provs = get_available_providers()
|
553 |
def_prov = avail_provs[0] if avail_provs else None
|
554 |
def_models = get_model_display_names_for_provider(def_prov) if def_prov else []
|
555 |
def_model_disp = get_default_model_display_name_for_provider(def_prov) if def_prov else None
|
556 |
|
557 |
+
# Moved status bar below the main title for better flow
|
558 |
+
with gr.Row(elem_classes="status-bar-group"): # Use elem_classes for easier targeting
|
559 |
with gr.Column(scale=3): agent_stat_tb = gr.Textbox(label="Agent Status", interactive=False, lines=1, value="Initializing systems...")
|
560 |
with gr.Column(scale=1): memory_backend_info_tb = gr.Textbox(label="Memory Backend", value=f"{MEMORY_STORAGE_BACKEND}", interactive=False)
|
561 |
if MEMORY_STORAGE_BACKEND == "SQLITE":
|
562 |
+
with gr.Column(scale=2): gr.Textbox(label="SQLite Path", value=f"{MEMORY_SQLITE_PATH}", interactive=False, elem_id="sqlite_path_display") # Added elem_id for potential specific styling
|
563 |
elif MEMORY_STORAGE_BACKEND == "HF_DATASET":
|
564 |
+
with gr.Column(scale=2): gr.Textbox(label="HF Repos", value=f"M: {MEMORY_HF_MEM_REPO}, R: {MEMORY_HF_RULES_REPO}", interactive=False, elem_id="hf_repos_display")
|
565 |
|
566 |
with gr.Tabs() as main_tabs:
|
567 |
+
with gr.TabItem("βοΈ Agent Configuration & π¬ Chat", id=0): # Combined Config and Chat
|
568 |
+
with gr.Row(equal_height=False): # Allow columns to size independently
|
569 |
with gr.Column(scale=1, min_width=380): # Sidebar for config
|
570 |
gr.Markdown("## βοΈ LLM Configuration")
|
571 |
+
with gr.Group(): # Removed elem_classes="compact-group" unless specifically needed for sub-styling
|
572 |
prov_sel_dd = gr.Dropdown(label="AI Provider", choices=avail_provs, value=def_prov, interactive=True)
|
573 |
model_sel_dd = gr.Dropdown(label="AI Model", choices=def_models, value=def_model_disp, interactive=True)
|
574 |
api_key_tb = gr.Textbox(label="API Key Override (Optional)", type="password", placeholder="Paste key for selected provider")
|
575 |
with gr.Group():
|
576 |
+
sys_prompt_tb = gr.Textbox(label="System Prompt Base", lines=10, value=DEFAULT_SYSTEM_PROMPT, interactive=True)
|
577 |
|
578 |
with gr.Column(scale=2): # Main chat area
|
579 |
gr.Markdown("## π¬ AI Chat Interface")
|
|
|
582 |
user_msg_tb = gr.Textbox(show_label=False, placeholder="Ask your research question or give an instruction...", scale=7, lines=1, max_lines=5, autofocus=True)
|
583 |
send_btn = gr.Button("Send", variant="primary", scale=1, min_width=100)
|
584 |
|
585 |
+
with gr.Accordion("π Full Response / Output Details", open=False): # Initially closed
|
586 |
fmt_report_tb = gr.Textbox(label="Full AI Response", lines=10, interactive=True, show_copy_button=True, value="*AI responses will appear here...*")
|
587 |
dl_report_btn = gr.DownloadButton("Download Report", interactive=False, visible=False)
|
588 |
detect_out_md = gr.Markdown("*Insights used or other intermediate details will show here...*")
|
589 |
|
590 |
with gr.TabItem("π§ Knowledge Base Management", id=1):
|
591 |
+
gr.Markdown("## Manage Stored Knowledge") # Top level header for the tab
|
592 |
with gr.Row(equal_height=False):
|
593 |
with gr.Column(scale=1):
|
594 |
+
with gr.Box(): # Using Box for a slightly more contained look
|
595 |
+
gr.Markdown("### π Rules (Learned Insights)")
|
596 |
+
rules_disp_ta = gr.TextArea(label="View/Edit Rules", lines=15, interactive=True, placeholder="Load or type rules here (one per line or '---' separated for multiple).")
|
597 |
+
with gr.Row():
|
598 |
+
view_rules_btn = gr.Button("π Load/Refresh Rules View"); save_edited_rules_btn = gr.Button("πΎ Save Edited Rules", variant="primary")
|
599 |
+
upload_rules_fobj = gr.File(label="Upload Rules File (.txt/.jsonl)", file_types=[".txt", ".jsonl"])
|
600 |
+
rules_stat_tb = gr.Textbox(label="Rules Operation Status", interactive=False, lines=2, placeholder="Status of rule operations...")
|
601 |
+
with gr.Row():
|
602 |
+
clear_rules_btn = gr.Button("β οΈ Clear All Rules", variant="stop")
|
603 |
+
save_faiss_ram_btn_kb = gr.Button("Save FAISS Indices", visible=(MEMORY_STORAGE_BACKEND == "RAM"))
|
604 |
|
605 |
with gr.Column(scale=1):
|
606 |
+
with gr.Box():
|
607 |
+
gr.Markdown("### π Memories (Past Interactions)")
|
608 |
+
mems_disp_json = gr.JSON(label="View Memories (JSON format)", scale=2)
|
609 |
+
with gr.Row(): view_mems_btn = gr.Button("π Load/Refresh Memories View")
|
610 |
+
upload_mems_fobj = gr.File(label="Upload Memories File (.jsonl)", file_types=[".jsonl"])
|
611 |
+
mems_stat_tb = gr.Textbox(label="Memories Operation Status", interactive=False, lines=2, placeholder="Status of memory operations...")
|
612 |
+
clear_mems_btn = gr.Button("β οΈ Clear All Memories", variant="stop")
|
613 |
|
614 |
+
# --- Event Handlers (remain the same as your last correct version) ---
|
615 |
def dyn_upd_model_dd(sel_prov_dyn:str): models_dyn, def_model_dyn = get_model_display_names_for_provider(sel_prov_dyn), get_default_model_display_name_for_provider(sel_prov_dyn); return gr.Dropdown(choices=models_dyn, value=def_model_dyn, interactive=True)
|
616 |
prov_sel_dd.change(fn=dyn_upd_model_dd, inputs=prov_sel_dd, outputs=model_sel_dd)
|
617 |
chat_ins = [user_msg_tb, main_chat_disp, prov_sel_dd, model_sel_dd, api_key_tb, sys_prompt_tb]
|
|
|
657 |
|
658 |
demo.load(fn=app_load_fn, inputs=None, outputs=[agent_stat_tb, rules_disp_ta, mems_disp_json])
|
659 |
|
660 |
+
|
661 |
if __name__ == "__main__":
|
662 |
+
logger.info(f"Starting Gradio AI Research Mega Agent (v5.3 with UI fixes & Advanced Memory: {MEMORY_STORAGE_BACKEND})...")
|
663 |
app_port, app_server = int(os.getenv("GRADIO_PORT", 7860)), os.getenv("GRADIO_SERVER_NAME", "127.0.0.1")
|
664 |
app_debug, app_share = os.getenv("GRADIO_DEBUG", "False").lower()=="true", os.getenv("GRADIO_SHARE", "False").lower()=="true"
|
665 |
logger.info(f"Launching Gradio server: http://{app_server}:{app_port}. Debug: {app_debug}, Share: {app_share}")
|
666 |
+
demo.queue().launch(server_name=app_server, server_port=app_port, debug=app_debug, share=app_share) # fill_height might not be needed with body/container min-height
|
667 |
logger.info("Gradio application shut down.")
|