mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-09-10 20:04:52 +00:00
fix: tokens.py
allows backward compatibility with Python3.8
This commit is contained in:
parent
6df43da0a4
commit
a27de21afa
@ -337,7 +337,7 @@ class HeterogeneousSampling:
|
|||||||
|
|
||||||
|
|
||||||
def batch_top_tokens(
|
def batch_top_tokens(
|
||||||
top_n_tokens: list[int], top_n_tokens_tensor: torch.Tensor, logprobs: torch.Tensor
|
top_n_tokens: List[int], top_n_tokens_tensor: torch.Tensor, logprobs: torch.Tensor
|
||||||
) -> Tuple[List[List[int]], List[List[float]]]:
|
) -> Tuple[List[List[int]], List[List[float]]]:
|
||||||
"""Find the top n most likely tokens for a batch of generations.
|
"""Find the top n most likely tokens for a batch of generations.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user