GithubHelp home page GithubHelp logo

Comments (8)

MaartenGr avatar MaartenGr commented on May 8, 2024

This is currently not supported as Flair, which is the main method for using embedding models, uses hugginface transformers which is typically not meant for importing onnx structures in part due to their tokenization structure. Exporting to onnx is possible however.

from keybert.

sujithjoseph avatar sujithjoseph commented on May 8, 2024

This is available in sentencetransformers - https://github.com/UKPLab/sentence-transformers/blob/72da7293186700bff4fed8e81adcfe40a03be1d2/examples/onnx_inference/onnx_inference.ipynb . We can load an onnx model for inference. With a local path to onnx exported file, it could be added as one more backend . Did test it with tinyBERT exported onnx model, but didnt see much performance gain on a V100. yet to try on a T4 GPU.

from keybert.

MaartenGr avatar MaartenGr commented on May 8, 2024

Thank you for the link! I did not realize it was already available in sentence-transformers. The main difficulty though will be loading in custom ONNX models that require some processing before it can be used in sentence-transformers.

from keybert.

sujithjoseph avatar sujithjoseph commented on May 8, 2024

I am thinking of adding it as a custom backend. i didnt see this before - https://maartengr.github.io/KeyBERT/guides/embeddings.html#custom-backend

from keybert.

MaartenGr avatar MaartenGr commented on May 8, 2024

Yes, if you can create a custom backend that loads in using the sentence-transformer then that would solve your issue. It would also be nice if that backend could then be added to KeyBERT but that would also depend on dependencies and implementation.

from keybert.

MaartenGr avatar MaartenGr commented on May 8, 2024

Since this issue has been a while without activity, I'll be closing it for now. However, if you are still experiencing the issue or want to discuss it further, let me know!

from keybert.

sujithjoseph avatar sujithjoseph commented on May 8, 2024

from keybert.

Matthieu-Tinycoaching avatar Matthieu-Tinycoaching commented on May 8, 2024

Hi @MaartenGr @sujithjoseph did you manage to deal with ONNX backend?

from keybert.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.