fix: tokens.py

allows backward compatibility with Python3.8
This commit is contained in:
Martin Vejvar 2023-10-05 15:04:24 +09:00 committed by GitHub
parent 6df43da0a4
commit a27de21afa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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.