Spaces:
Runtime error
Runtime error
Update app.py
Browse filesmore errors π
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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__":
|