Skip to content

[Question]: How to run Flair SequenceTagger inference with ONNX? #3687

@DaniSalva

Description

@DaniSalva

Question

Hi everyone!

I’m trying to optimize inference speed for a Flair Sequence tagger (flair/ner-lang-large) model based on XLM-R using ONNX to improve CPU performance.

I followed the guide here and managed to export the model to ONNX succesfully. However, I'm not sure how to actually run inference in an ONNX environment (using onnxruntime) and get the same prediction as with Flair.

Does anyone have an example or code snippet showing how to perform inference with a flair model in ONNX? I also tried JIT but I hadn't speed improvements.
Any reference or working example would be greatly appreciated🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions