Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,8 @@ except Exception as e:
|
|
| 10 |
|
| 11 |
def chat_logic(message, history, mode_selection):
|
| 12 |
if not chimera:
|
| 13 |
-
|
|
|
|
| 14 |
return history, ""
|
| 15 |
|
| 16 |
# Map friendly names
|
|
@@ -28,24 +29,34 @@ def chat_logic(message, history, mode_selection):
|
|
| 28 |
# Format output
|
| 29 |
final_response = f"**[{active_module} Active]**\n\n{response_text}"
|
| 30 |
|
| 31 |
-
|
| 32 |
-
|
|
|
|
| 33 |
|
| 34 |
return history, ""
|
| 35 |
|
|
|
|
| 36 |
custom_css = """
|
| 37 |
body {background-color: #0b0f19; color: #c9d1d9;}
|
| 38 |
.gradio-container {font-family: 'IBM Plex Mono', monospace;}
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
"""
|
| 41 |
|
| 42 |
-
with gr.Blocks(
|
| 43 |
gr.Markdown("# βοΈ AXON: QWEN TRINITY")
|
| 44 |
-
gr.Markdown("*> Pipeline: Gemini (Plan) β Qwen
|
| 45 |
|
| 46 |
with gr.Row():
|
| 47 |
with gr.Column(scale=4):
|
| 48 |
-
|
|
|
|
|
|
|
| 49 |
with gr.Column(scale=1):
|
| 50 |
mode = gr.Dropdown(
|
| 51 |
choices=["Auto (Router)", "β‘ ASM (Qwen + Llama)", "π¬ SFE (Data/Science)", "π¨ CSM (Story/Creative)"],
|
|
@@ -57,4 +68,5 @@ with gr.Blocks(css=custom_css, title="Axon Trinity") as demo:
|
|
| 57 |
msg.submit(chat_logic, [msg, chatbot, mode], [chatbot, msg])
|
| 58 |
|
| 59 |
if __name__ == "__main__":
|
| 60 |
-
|
|
|
|
|
|
| 10 |
|
| 11 |
def chat_logic(message, history, mode_selection):
|
| 12 |
if not chimera:
|
| 13 |
+
# Classic Tuple Error Message
|
| 14 |
+
history.append((message, "β Error: API Keys missing. Check Settings -> Secrets."))
|
| 15 |
return history, ""
|
| 16 |
|
| 17 |
# Map friendly names
|
|
|
|
| 29 |
# Format output
|
| 30 |
final_response = f"**[{active_module} Active]**\n\n{response_text}"
|
| 31 |
|
| 32 |
+
# --- THE FIX: USE TUPLES (Classic Format) ---
|
| 33 |
+
# format: (user_message, assistant_message)
|
| 34 |
+
history.append((message, final_response))
|
| 35 |
|
| 36 |
return history, ""
|
| 37 |
|
| 38 |
+
# --- Sci-Fi Theme CSS ---
|
| 39 |
custom_css = """
|
| 40 |
body {background-color: #0b0f19; color: #c9d1d9;}
|
| 41 |
.gradio-container {font-family: 'IBM Plex Mono', monospace;}
|
| 42 |
+
header {display: none !important;}
|
| 43 |
+
#chatbot {
|
| 44 |
+
height: 600px;
|
| 45 |
+
border: 1px solid #30363d;
|
| 46 |
+
background-color: #0d1117;
|
| 47 |
+
border-radius: 12px;
|
| 48 |
+
}
|
| 49 |
"""
|
| 50 |
|
| 51 |
+
with gr.Blocks(title="Axon Trinity") as demo:
|
| 52 |
gr.Markdown("# βοΈ AXON: QWEN TRINITY")
|
| 53 |
+
gr.Markdown("*> Pipeline: Gemini (Plan) β Qwen 3 (Code) β Llama 3.3 (Refine)*")
|
| 54 |
|
| 55 |
with gr.Row():
|
| 56 |
with gr.Column(scale=4):
|
| 57 |
+
# FIXED: Removed type="messages"
|
| 58 |
+
chatbot = gr.Chatbot(elem_id="chatbot")
|
| 59 |
+
|
| 60 |
with gr.Column(scale=1):
|
| 61 |
mode = gr.Dropdown(
|
| 62 |
choices=["Auto (Router)", "β‘ ASM (Qwen + Llama)", "π¬ SFE (Data/Science)", "π¨ CSM (Story/Creative)"],
|
|
|
|
| 68 |
msg.submit(chat_logic, [msg, chatbot, mode], [chatbot, msg])
|
| 69 |
|
| 70 |
if __name__ == "__main__":
|
| 71 |
+
# CSS moved here to fix the warning
|
| 72 |
+
demo.launch(css=custom_css)
|