import gradio as gr import os from loader import loader from tutor import run_council_deliberation from inference import generate_universal_heatmap # NerdMedica Dark Tech CSS CSS = """ body, .gradio-container { background-color: #0A0E1A !important; color: #D1D5DB !important; } .gr-button-primary { background: linear-gradient(90deg, #E5534B, #A855F7) !important; border: none !important; border-radius: 8px !important; color: white !important; font-weight: bold !important; } #header { border-bottom: 2px solid #E5534B; padding-bottom: 15px; margin-bottom: 25px; } .message.user { background-color: #1F2937 !important; border-left: 4px solid #E5534B !important; } .message.bot { background-color: #111827 !important; border-left: 4px solid #3B82F6 !important; } """ def medical_audit_pipeline(image, modality, question, history): loader.clear_vram() # 1. Visual Evidence (If image exists) heatmap = None if image is not None: clip_model, preprocess = loader.load_biomed_clip() heatmap = generate_universal_heatmap(image, question, clip_model, preprocess) # 2. Council Deliberation response = run_council_deliberation(image, modality, question) # Append to Chat History history.append({"role": "user", "content": question}) history.append({"role": "assistant", "content": response}) return history, heatmap, response # Gradio 6.0: We build the blocks without passing theme/css here with gr.Blocks() as demo: gr.HTML("