Transformers.js help
Hi there,
first of all, thanks so much for the onnx converison.
I would like to run this model in the browser, but I am having trouble on getting going with this. I started looking into the onnx web runtime but then found the transformers.js lib which seems to make this process easier. I however dont really know how to prepare the inputs for this model, so that you can pass it text and labels and get an output. I saw that some of you also waited for ONNX support of the model, so maybe you can shed some light on how to run this model with the onnx runtime.
Thanks a lot :)
Yes it's not trivial. Basically need to port their GLiNER library code from Python to JS via TransformersJS. The code is here: https://github.com/urchade/GLiNER/blob/065862199291c72899bb4559d5e9ae5c4c5818b0/gliner/model.py#L247
The code mostly involves tokenizing the input, preparing the IDs, then sending the parameters to the model and matching the output back to tokens + finding location.