Commit 68ee98a
authored
server : return HTTP 400 if prompt exceeds context length (#16486)
In streaming mode when prompt exceeds context length, the server returns
HTTP 200 status code with a JSON error in the body. This is very
confusing and inconsistent with all other inference engines which return
HTTP 4xx error in this case.
This patch fixes this problem and makes the server return HTTP 400 in
such cases.1 parent cdb6da4 commit 68ee98a
File tree
3 files changed
+40
-2
lines changed- tools/server
- tests
- unit
3 files changed
+40
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3727 | 3727 | | |
3728 | 3728 | | |
3729 | 3729 | | |
3730 | | - | |
| 3730 | + | |
3731 | 3731 | | |
3732 | 3732 | | |
3733 | 3733 | | |
| |||
4955 | 4955 | | |
4956 | 4956 | | |
4957 | 4957 | | |
4958 | | - | |
| 4958 | + | |
4959 | 4959 | | |
4960 | 4960 | | |
| 4961 | + | |
| 4962 | + | |
| 4963 | + | |
| 4964 | + | |
| 4965 | + | |
| 4966 | + | |
| 4967 | + | |
| 4968 | + | |
4961 | 4969 | | |
4962 | 4970 | | |
4963 | 4971 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
411 | 433 | | |
412 | 434 | | |
413 | 435 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
38 | 44 | | |
39 | 45 | | |
40 | 46 | | |
| |||
297 | 303 | | |
298 | 304 | | |
299 | 305 | | |
| 306 | + | |
| 307 | + | |
300 | 308 | | |
301 | 309 | | |
302 | 310 | | |
| |||
0 commit comments