Commit 02aa9f9
committed
fix: handle missing content-length header in _get_tokenizer_config_size
When a server uses chunked transfer encoding, neither content-length nor
x-goog-stored-content-length headers are present, leaving size as None.
The subsequent int() cast then raises a TypeError.
Add an explicit None check that raises a ValueError instead, which is
caught gracefully by the existing try/except in both callers (get_hf_tokenizer
and async_get_hf_tokenizer) — tokenizer download proceeds normally.
Fixes: #7621 parent 756b1d8 commit 02aa9f9
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
0 commit comments