Skip to content

Return_offsets_mapping when decoding #1769

Closed
@Boltzmachine

Description

@Boltzmachine

I want to get the character offset mapping of tokens when decoding for model-generated ids, similar to the return_offsets_mapping in tokenizer.call. But I cannot find out how to do it. For some tokenizers, I try first decoding the generated ids to text and encoding it back and get the char offset mapping. However , input_ids == tokenizer.encode(tokenizer.decode(input_ids) is not always true.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions