Skip to content

Can't load onnx pretrained model without pytorch model file #314

@darpleon

Description

@darpleon

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions