ITADN

Can't load onnx pretrained model without pytorch model file

#314Opendarpleon 创建于 2025-12-11
D
darpleoncommented
Hi! I found a bug. `GLiNER.from_pretrained()` raises `FileNotFoundError` when trying to load an onnx model. Looking at the code of `from_pretrained()`, it checks for a pytorch model file before checking if `load_onnx_model` is set. I think this check could be moved to the `if not load_onnx_model:` block. I discovered the bug on v0.2.24, and it seems to have been introduced in v0.2.23.
0 条评论