Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -370,14 +370,14 @@ async def generate_text(
|
|
| 370 |
raise HTTPException(400, "messages[] is required")
|
| 371 |
|
| 372 |
total_chars, total_bytes = calculate_messages_size(messages)
|
| 373 |
-
if total_chars > MAX_CHAT_PROMPT_CHARS or total_bytes > MAX_CHAT_PROMPT_BYTES:
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
|
| 382 |
prompt_text = extract_user_text(messages)
|
| 383 |
|
|
|
|
| 370 |
raise HTTPException(400, "messages[] is required")
|
| 371 |
|
| 372 |
total_chars, total_bytes = calculate_messages_size(messages)
|
| 373 |
+
# if total_chars > MAX_CHAT_PROMPT_CHARS or total_bytes > MAX_CHAT_PROMPT_BYTES:
|
| 374 |
+
# raise HTTPException(
|
| 375 |
+
# status_code=413,
|
| 376 |
+
# detail=(
|
| 377 |
+
# f"Prompt context too large ({total_chars} chars, {total_bytes} bytes). "
|
| 378 |
+
# f"Max allowed is {MAX_CHAT_PROMPT_CHARS} chars or {MAX_CHAT_PROMPT_BYTES} bytes."
|
| 379 |
+
# ),
|
| 380 |
+
# )
|
| 381 |
|
| 382 |
prompt_text = extract_user_text(messages)
|
| 383 |
|