xenova / transformers.js

State-of-the-art Machine Learning for the web. Run 🤗 Transformers directly in your browser, with no need for a server!
https://huggingface.co/docs/transformers.js
Apache License 2.0
9.87k stars 582 forks source link

Support for GLiNER models? #826

Open Madd0g opened 3 days ago

Madd0g commented 3 days ago

Question

is there a reason why models from the GLiNER family can't be supported?

I see they use a specialized library, does it take a lot of code to make them work?

xenova commented 3 days ago

Hi there 👋 I looked into this a few months ago, and indeed it's a bit more complicated than most models: https://github.com/urchade/GLiNER/issues/34#issuecomment-2037412469. They do have a conversion script (https://github.com/urchade/GLiNER/blob/main/examples/convert_to_onnx.ipynb), but there's still a lot of work you need to do yourself for pre- and post-processing. Is this something you'd be interested in looking into?

Madd0g commented 2 days ago

ha. I realized I already saw that thread when I first found GLiNER and I even remember noticing your comment there. But I completely forgot about it, my bad.

Is this something you'd be interested in looking into?

  1. I haven't even experimented with the python version yet, it's on my shortlist of things to test.
  2. I'm far from an expert with onnx/wasm stuff - but maybe in the future?

Thank you!