Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Loading ONNX model requires config file #319

@fw7th

Description

@fw7th

Hey! I believe this is a bug.

Post ONNX conversion w/ convert_to_onnx.py, a config file is not created, however during inference using GLiNER.from_pretrained() with load_onnx_model=True specified, a gliner_config file is required.

I tried copying the original config file to the onnx_model directory, it still does not work. I believe this check:

        # Load config
        config_file = model_dir / "gliner_config.json"
        if not config_file.exists():
            raise FileNotFoundError(f"No config file found in {model_dir}")

should be moved to the if block:

        if not load_onnx_model:
              ...

I'm unsure if this would cause further breaking changes. This is reproducable across at least 2 environments.
gliner version == 0.2.24

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