Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
| 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 |
-
#
|
| 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)
|