Git Product home page Git Product logo

Comments (2)

guillaume-be avatar guillaume-be commented on June 23, 2024

Hello @cicero-ai ,

I would look in the direction of https://github.com/huggingface/transformers/blob/d1d94d798f1ed5c0b5de9a794381aeb7dc319c12/src/transformers/modeling_utils.py#L4082 to see how Python libraries are doing it. It seems indeed the files are not combined into a single file but rather opened sequentially and loaded in the model (the example given uses safetensors, I am unsure if you can open the individual shard files you are considering and get a valid weights dictionary).

One approach could be to create a new Resource pointing to a folder and a regex/file pattern for the archive files. You could then extend the load_weights method to handle this resource, looping through the matching shards and loading them into the model

from rust-bert.

cicero-ai avatar cicero-ai commented on June 23, 2024

Great, that should be all the direction I need and thank you very much for your time. One way or another it's imperative I get this working, so you'll have a PR shortly. Whether or not you want to merge it is up to you.

Actually, while I'm here one more thing -- word embeddings. Sentence embeddings work great, but I can't find a single word embeddings LLM that has a vocab resource for obvious reasons. I'm sure I can figure this one out myself and will also include PR for it, but since I'm here, if you have any directional advice on implementing word embeddings, I'm all ears.

Cheers,
Matt

from rust-bert.

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.