Instructions to use NovaSearch/stella_en_1.5B_v5 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use NovaSearch/stella_en_1.5B_v5 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("NovaSearch/stella_en_1.5B_v5", trust_remote_code=True) sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Transformers
How to use NovaSearch/stella_en_1.5B_v5 with Transformers:
# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("NovaSearch/stella_en_1.5B_v5", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("NovaSearch/stella_en_1.5B_v5", trust_remote_code=True) - Notebooks
- Google Colab
- Kaggle
AttributeError: 'DynamicCache' object has no attribute 'get_usable_length'. Did you mean: 'get_seq_length'?
sentence-transformers 5.1.0
setuptools 80.9.0
sympy 1.14.0
threadpoolctl 3.6.0
tokenizers 0.21.4
tomli 2.2.1
torch 2.8.0
torchvision 0.23.0+cu129
tqdm 4.67.1
transformers 4.55.2
past_key_values_length = past_key_values.get_usable_length(seq_length)
AttributeError: 'DynamicCache' object has no attribute 'get_usable_length'. Did you mean: 'get_seq_length'?
past_key_values_length = past_key_values.get_usable_length(seq_length)
AttributeError: 'DynamicCache' object has no attribute 'get_usable_length'. Did you mean: 'get_seq_length'?
This was removed in transformers in this PR - https://github.com/huggingface/transformers/pull/39106 I think everything in tranformers 4.46.0
We've done a fix and reimplemented the removed function here: https://huggingface.co/it-just-works/stella_en_1.5B_v5_bf16/commit/03aedd040580357ec688f3467f1109af5e053249
This is not Github otherwise I would have done a PR back to this repo with the fix, but maybe @infgrad can apply the changes from the above commit.
You can also use this mirror which has the fix applied: https://huggingface.co/it-just-works/stella_en_1.5B_v5_bf16