AIencoder commited on
Commit
09778d5
·
verified ·
1 Parent(s): 1ae611f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -27,13 +27,12 @@ def chat_logic(message, image_file, history, mode):
27
  final_response = f"**[{active_module} Active]**\n\n{response_text}"
28
 
29
  # 4. Append to History (Universal List Format)
30
- # We do NOT use dictionaries. We use simple lists.
31
  if image_file:
32
  user_msg = f"[Uploaded Image] {message}"
33
  else:
34
  user_msg = message
35
 
36
- # Append as [UserMessage, BotMessage]
37
  history.append([user_msg, final_response])
38
 
39
  return history, "", None
@@ -49,7 +48,6 @@ with gr.Blocks(title="Axon God Mode", css=custom_css) as demo:
49
  gr.Markdown("*> Modules: VIM (Vision) | NET (Web) | IGM (Art) | ASM (Code)*")
50
 
51
  with gr.Row():
52
- # No 'type' argument. Defaults to Lists (Universal)
53
  chatbot = gr.Chatbot(height=500, elem_id="chatbot")
54
 
55
  with gr.Row():
@@ -77,5 +75,5 @@ with gr.Blocks(title="Axon God Mode", css=custom_css) as demo:
77
  )
78
 
79
  if __name__ == "__main__":
80
- # CRITICAL: Disable SSR to prevent the 'Invalid file descriptor' crash
81
  demo.launch(ssr_mode=False)
 
27
  final_response = f"**[{active_module} Active]**\n\n{response_text}"
28
 
29
  # 4. Append to History (Universal List Format)
30
+ # We use simple lists [User, Bot] which works on Gradio 5.x
31
  if image_file:
32
  user_msg = f"[Uploaded Image] {message}"
33
  else:
34
  user_msg = message
35
 
 
36
  history.append([user_msg, final_response])
37
 
38
  return history, "", None
 
48
  gr.Markdown("*> Modules: VIM (Vision) | NET (Web) | IGM (Art) | ASM (Code)*")
49
 
50
  with gr.Row():
 
51
  chatbot = gr.Chatbot(height=500, elem_id="chatbot")
52
 
53
  with gr.Row():
 
75
  )
76
 
77
  if __name__ == "__main__":
78
+ # Disable SSR to prevent the 'Invalid file descriptor' crash
79
  demo.launch(ssr_mode=False)