[Bugfix] Fix vLLM UsageInfo and logprobs None AssertionError with empty token_ids (#9034)

Co-authored-by: Nick Hill <nickhill@us.ibm.com>
This commit is contained in:
Chang Su
2024-10-15 15:40:43 -07:00
committed by GitHub
co-authored by Nick Hill
parent 22f8a69549
commit ba30942240
4 changed files with 140 additions and 2 deletions
+3
View File
@@ -532,6 +532,9 @@ class Sequence:
# (which is what we have most of the time)
return self.data._cached_all_token_ids[-1]
if num_new_tokens == 0:
return []
return self.data._cached_all_token_ids[-num_new_tokens:]
def hash_of_block(self, logical_idx: int) -> int: