8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c8f4dc commit 3fc9147Copy full SHA for 3fc9147
llama_cpp/server/app.py
@@ -601,10 +601,9 @@ def logit_bias_processor(
601
input_ids: npt.NDArray[np.intc],
602
scores: npt.NDArray[np.single],
603
) -> npt.NDArray[np.single]:
604
- new_scores = [None] * len(scores)
605
- for input_id, score in enumerate(scores):
606
- new_scores[input_id] = score + to_bias.get(input_id, 0.0)
607
-
+ new_scores = np.copy(scores) # Does it make sense to copy the whole array or can we just overwrite the original one?
+ for input_id, score in to_bias.items():
+ new_scores[input_id] = score + scores[input_id]
608
return new_scores
609
610
return logit_bias_processor
0 commit comments