Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 99ff175

Browse filesBrowse files
committed
Check if completion_tokens is none in error handler.
1 parent 12b7f2f commit 99ff175
Copy full SHA for 99ff175

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎llama_cpp/server/errors.py

Copy file name to clipboardExpand all lines: llama_cpp/server/errors.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def context_length_exceeded(
7272
return 400, ErrorResponse(
7373
message=message.format(
7474
context_window,
75-
completion_tokens + prompt_tokens,
75+
(completion_tokens or 0) + prompt_tokens,
7676
prompt_tokens,
7777
completion_tokens,
7878
), # type: ignore

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.