Repository navigation
Fix for long inputs crashing inference, plus documentation and
dependency updates.
- Fixed a crash on long descriptions: some fine-tuned repos (notably the
Chinese MacBERT model) ship nomodel_max_lengthin their
tokenizer_config.json, so transformers reports a huge sentinel value
andtruncation=Truenever actually truncated — inputs over 512
tokens overflowed the model's position-embedding table at inference
time. Both classifiers now clamp the tokenizer's limit to the model's
max_position_embeddings(minus the two offset slots RoBERTa-style
models reserve) right after loading, via a shared
clamp_tokenizer_max_lengthhelper with its own test suite. - Documentation: the README now shows
HF_HUB_OFFLINE=1as an example
of starting the server without pulling model updates from the
Hugging Face Hub. - Updated dependencies.