[1.0.0rc2] 编码时 ids_array 发生崩溃,而另一个线程正在解码 ids
作者: nimbrel创建于 2026年9月26日更新于 2026年9月28日
Reading `enc.ids_array` while another thread runs `tok.decode()` on that same array raises "PanicException: called `Result::unwrap()` on an `Err` value: AlreadyBorrowed". It happens on the normal GIL build. A thread pool where one worker decodes an encoding while another reads its arrays hits it. `PanicException` derives from `BaseException`, so `except Exception` misses it and the thread dies.
内容来源: huggingface/tokenizers