HydroFlyer53 commited on
Commit
ab96f64
Β·
verified Β·
1 Parent(s): 77dc586

Update app.py

Browse files

more errors πŸ™„

Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -43,7 +43,16 @@ def chat_with_ai(message, history):
43
  return history, [{"role": "assistant", "content": "There was an error processing your message."}]
44
 
45
  # Gradio Chat Interface
46
- demo = gr.ChatInterface(fn=chat_with_ai)
 
 
 
 
 
 
 
 
 
47
 
48
 
49
  if __name__ == "__main__":
 
43
  return history, [{"role": "assistant", "content": "There was an error processing your message."}]
44
 
45
  # Gradio Chat Interface
46
+ def chat_with_ai(message, history=None):
47
+ try:
48
+ # Your existing code here
49
+ response = my_model_generate(message, history)
50
+ return response
51
+ except Exception as e:
52
+ import traceback
53
+ traceback.print_exc() # print full error to logs
54
+ return f"❌ Internal error: {e}"
55
+
56
 
57
 
58
  if __name__ == "__main__":