[Feature] Get Token IDs with Engine.generate() (#2636)
Co-authored-by: Chayenne <zhaochen20@outlook.com>
This commit is contained in:
@@ -323,7 +323,9 @@ class BatchTokenIDOut:
|
||||
decoded_texts: List[str]
|
||||
decode_ids: List[int]
|
||||
read_offsets: List[int]
|
||||
# Only used when `--skip-tokenizer-init`
|
||||
# Only used when --return-token-ids` is set
|
||||
origin_input_ids: Optional[List[int]]
|
||||
# Only used when `--skip-tokenizer-init` or `--return-token-ids` is set
|
||||
output_ids: Optional[List[int]]
|
||||
# Detokenization configs
|
||||
skip_special_tokens: List[bool]
|
||||
@@ -354,6 +356,10 @@ class BatchStrOut:
|
||||
# The output decoded strings
|
||||
output_strs: List[str]
|
||||
|
||||
# The token ids
|
||||
origin_input_ids: Optional[List[int]]
|
||||
output_ids: Optional[List[int]]
|
||||
|
||||
# Token counts
|
||||
prompt_tokens: List[int]
|
||||
completion_tokens: List[int]
|
||||
|
||||
Reference in New Issue
Block a user