Skip to content

Bug: uncaught type error in _get_tokenizer_config_size when server omits content length #762

@dushyantzz

Description

@dushyantzz

Hey team! While reviewing the manually_maintained modules, I noticed a potential failure point in tokenizers.py when initializing local tokenizers.
currently, _get_tokenizer_config_size assumes that the content length or x-goog-stored-content-length headers will always be present in the HTTP response. However, if the server responds with Chunked Transfer Encoding, these headers are omitted. When this happens, size defaults to None, and the subsequent int(typing.cast(int, size)) throws a TypeError, causing the tokenizer initialization to fail unexpectedly.

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