I've been trying to port the Hugging Face's model sentence-transformers/multi-qa-distilbert-cos-v1 using the rust-bert library for the purpose of obtaining Sentence Embeddings. Even though Distilbert is supported, I'm encountering an error.
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: TchError("cannot find the tensor named distilbert.transformer.layer.4.attention.v_lin.weight in resources/multi-qa-distilbert-cos-v1__finetuned_2/rust_model.ot")', src/models/base/player_embedding.rs:33:14
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
It seems the tensor distilbert.transformer.layer.4.attention.v_lin.weight is not found in the model file. This is surprising as this tensor is usually part of the standard DistilBert model structure.
Steps to reproduce:
Download sentence-transformers/multi-qa-distilbert-cos-v1 from HuggingFace Hub.
Convert pytorch-model.bin using rust-bert's convert_model
Run examples/sentence_embedding_local.rs and changing it to the model in question.
I've been trying to port the Hugging Face's model
sentence-transformers/multi-qa-distilbert-cos-v1
using the rust-bert library for the purpose of obtaining Sentence Embeddings. Even though Distilbert is supported, I'm encountering an error.It seems the tensor
distilbert.transformer.layer.4.attention.v_lin.weight
is not found in the model file. This is surprising as this tensor is usually part of the standard DistilBert model structure.Steps to reproduce:
sentence-transformers/multi-qa-distilbert-cos-v1
from HuggingFace Hub.pytorch-model.bin
usingrust-bert
's convert_modelexamples/sentence_embedding_local.rs
and changing it to the model in question.rust-bert version: latest main branch (107fb214d9a891f1eb4d69b71f43b6b1c27b219e) os: Ubuntu 20.04 (focal) [64-bit]
Thanks!