Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -58,7 +58,7 @@ AVAILABLE_MODELS = {
|
|
| 58 |
|
| 59 |
# Chat memory (in-memory)
|
| 60 |
chat_histories = defaultdict(list)
|
| 61 |
-
MAX_HISTORY =
|
| 62 |
|
| 63 |
# Generate response stream
|
| 64 |
async def generate_ai_response(chat_id: str, model: str):
|
|
|
|
| 58 |
|
| 59 |
# Chat memory (in-memory)
|
| 60 |
chat_histories = defaultdict(list)
|
| 61 |
+
MAX_HISTORY = 100 # limit memory to avoid crashes
|
| 62 |
|
| 63 |
# Generate response stream
|
| 64 |
async def generate_ai_response(chat_id: str, model: str):
|