forked from phoenix-oss/llama-stack-mirror
[bugfix] Fix logprobs on meta-reference impl (#213)
* fix log probs * add back LogProbsConfig * error handling * bugfix
This commit is contained in:
parent
e4ae09d090
commit
4d5f7459aa
3 changed files with 36 additions and 7 deletions
|
@ -297,7 +297,7 @@ class Llama:
|
|||
token=next_token[0].item(),
|
||||
text=self.tokenizer.decode(next_token.tolist()),
|
||||
logprobs=(
|
||||
token_logprobs[:, prev_pos + 1 : cur_pos + 1][0].tolist()
|
||||
token_logprobs[:, cur_pos : cur_pos + 1][0].tolist()
|
||||
if logprobs
|
||||
else None
|
||||
),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue