Filter non-int token ids in benchmark and observe decode-side bootstrap/alloc metrics (#24684)
This commit is contained in:
@@ -66,8 +66,12 @@ def compute_random_lens(full_len: int, range_ratio: float, num: int) -> List[int
|
||||
|
||||
@lru_cache(maxsize=1)
|
||||
def get_available_tokens(tokenizer):
|
||||
"""Get all available token ids from the tokenizer vocabulary."""
|
||||
return list(tokenizer.get_vocab().values())
|
||||
"""Get valid token ids from the tokenizer vocabulary."""
|
||||
return [
|
||||
token_id
|
||||
for token_id in tokenizer.get_vocab().values()
|
||||
if isinstance(token_id, int)
|
||||
]
|
||||
|
||||
|
||||
def gen_prompt(tokenizer, token_num):
|
||||
|
||||
Reference in New Issue
Block a user