Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion tunix/generate/vllm_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,10 @@ def __call__(
decoded_outputs, out_logprobs, out_tokens = self.detokenize(
input_strings, outputs
)
if self.config.return_logprobs and (
out_logprobs is None or out_logprobs[0] is None
):
raise ValueError("Logprobs are not returned from the vLLM.")

max_tokens_length = max(len(x) for x in prompt_ids)

Expand All @@ -505,5 +509,5 @@ def __call__(
logits=None,
tokens=out_tokens[0],
padded_prompt_tokens=all_input_ids,
logprobs=out_logprobs[0] if len(out_logprobs[0]) else None,
logprobs=out_logprobs[0] if self.config.return_logprobs else None,
)
Loading