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 a05b4da

Browse filesBrowse files
committed
fix: float32 is not JSON serializable when streaming logits.
1 parent abda047 commit a05b4da
Copy full SHA for a05b4da

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+2
-2
lines changed

‎llama_cpp/llama.py

Copy file name to clipboardExpand all lines: llama_cpp/llama.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,7 +1555,7 @@ def logit_bias_processor(
15551555
)
15561556
token_offset = len(prompt_tokens) + returned_tokens
15571557
logits = self._scores[token_offset - 1, :]
1558-
current_logprobs = Llama.logits_to_logprobs(logits)
1558+
current_logprobs = Llama.logits_to_logprobs(logits).tolist()
15591559
sorted_logprobs = list(
15601560
sorted(
15611561
zip(current_logprobs, range(len(current_logprobs))),
@@ -1674,7 +1674,7 @@ def logit_bias_processor(
16741674
)
16751675
token_offset = len(prompt_tokens) + returned_tokens - 1
16761676
logits = self._scores[token_offset, :]
1677-
current_logprobs = Llama.logits_to_logprobs(logits)
1677+
current_logprobs = Llama.logits_to_logprobs(logits).tolist()
16781678
sorted_logprobs = list(
16791679
sorted(
16801680
zip(current_logprobs, range(len(current_logprobs))),

0 commit comments

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