AIencoder commited on
Commit
8807fb0
Β·
verified Β·
1 Parent(s): 225ce2f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -8
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
- history.append({"role": "assistant", "content": "❌ Error: API Keys missing."})
 
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
- history.append({"role": "user", "content": message})
32
- history.append({"role": "assistant", "content": final_response})
 
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
- #chatbot {height: 600px; border: 1px solid #30363d; background-color: #0d1117;}
 
 
 
 
 
 
40
  """
41
 
42
- with gr.Blocks(css=custom_css, title="Axon Trinity") as demo:
43
  gr.Markdown("# βš”οΈ AXON: QWEN TRINITY")
44
- gr.Markdown("*> Pipeline: Gemini (Plan) βž” Qwen 2.5 (Code) βž” Llama 3.3 (Refine)*")
45
 
46
  with gr.Row():
47
  with gr.Column(scale=4):
48
- chatbot = gr.Chatbot(elem_id="chatbot", type="messages")
 
 
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
- demo.launch()
 
 
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)