mirror of
https://github.com/NousResearch/atropos.git
synced 2026-04-22 16:48:57 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
d8857eb69f
commit
d1b0dee8f7
7 changed files with 53 additions and 19 deletions
|
|
@ -360,10 +360,16 @@ async def _generate(request_dict: dict, raw_request: Request) -> Response:
|
|||
ret["prompt_token_ids"] = final_output.prompt_token_ids
|
||||
ret["token_ids"] = [x.token_ids for x in final_output.outputs]
|
||||
|
||||
if sampling_params.prompt_logprobs is not None and final_output.prompt_logprobs is not None:
|
||||
if (
|
||||
sampling_params.prompt_logprobs is not None
|
||||
and final_output.prompt_logprobs is not None
|
||||
):
|
||||
ret["prompt_logprobs"] = [
|
||||
{int(tok_id): lp.logprob for tok_id, lp in pos.items()}
|
||||
if pos is not None else None
|
||||
(
|
||||
{int(tok_id): lp.logprob for tok_id, lp in pos.items()}
|
||||
if pos is not None
|
||||
else None
|
||||
)
|
||||
for pos in final_output.prompt_logprobs
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue