Comments (2)
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.
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)
- Is multilabel prediction correct? HOT 1
- Evaluation fails when trying to extract keywords from a specific sentence HOT 2
- Please expose tonekizer params on models where `forward_t` is exposed
- Downloading a model to a local Directory HOT 4
- Question: Configuring ZeroShotClassificationModel with DeBERTaV2 - Documentation HOT 1
- Upgrade Cargo dependencies HOT 2
- GPT-2 text generation throws an unexpected error HOT 4
- Any plan to release a new version? HOT 2
- Question: is it ok to continue after OOM error from `encode`
- update to be working with torch 2.2.0
- support for huggingface access token
- Error on running example in Linux
- RemoteResource doesn't allow loading safetensors models
- linking with `cc` failed: exit status: 1
- Double free or corruption (fasttop) HOT 1
- The example for linking the lib is incorrect.
- Feature Request: inference with rust bert models in asynchronous web applications HOT 1
- Converted msmarco-distilbert-cos-v5 model with convert_model.py fails when loaded with Tch tensor error: cannot find the tensor named distilbert.transformer.layer.0.attention.v_lin.bias HOT 2
- NER with BERT-based Model: Unexpected Panic During Prediction
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust-bert.