Spaces:
Sleeping
Sleeping
Dmitry Beresnev commited on
Commit ·
3634ca6
1
Parent(s): 7caa6ba
fix request parsing
Browse files- cpp/request_parsing.cpp +2 -2
cpp/request_parsing.cpp
CHANGED
|
@@ -56,8 +56,8 @@ std::optional<TokenEstimate> estimate_chat_tokens(
|
|
| 56 |
}
|
| 57 |
|
| 58 |
if (estimate.requested_max_tokens <= 0) {
|
| 59 |
-
|
| 60 |
-
|
| 61 |
}
|
| 62 |
|
| 63 |
for (const auto &message : payload["messages"]) {
|
|
|
|
| 56 |
}
|
| 57 |
|
| 58 |
if (estimate.requested_max_tokens <= 0) {
|
| 59 |
+
// -1 (and other non-positive values) is a sentinel meaning "unlimited" — use the default
|
| 60 |
+
estimate.requested_max_tokens = limits.default_max_tokens;
|
| 61 |
}
|
| 62 |
|
| 63 |
for (const auto &message : payload["messages"]) {
|