-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make token optional and private an argument, add template #39
Conversation
model2vec/model_card_template.md
Outdated
Alternatively, you can distill your own model using the `distill` method: | ||
```python | ||
from model2vec.distill import distill | ||
|
||
# Choose a Sentence Transformer model | ||
model_name = "BAAI/bge-base-en-v1.5" | ||
|
||
# Distill the model | ||
m2v_model = distill(model_name=model_name, pca_dims=256) | ||
|
||
# Save the model | ||
m2v_model.save_pretrained("m2v_model") | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually like this bit, it helps push people interested in the work to exploring it themselves. My comments regarding the "distillation should be secondary in the model card" was referring to:
Model2Vec distills a Sentence Transformer into a small, static model.
This model is ideal for applications requiring fast, lightweight embeddings.
This first sentence isn't really useful for someone just looking at the model card. Perhaps a better intro is:
This Model2Vec model is a distilled version of a Sentence Transformer that uses static embeddings, allowing text embeddings to be computed orders of magnitude faster on both GPU and CPU. It is designed for applications where computational resources are limited or where real-time performance is critical.
Or you can even use the Jinja template:
This Model2Vec model is a distilled version of {% if base_model %}the [{{ base_model }}](https://huggingface.co/{{ base_model }}){% else %}a{% endif %} Sentence Transformer that uses static embeddings, allowing text embeddings to be computed orders of magnitude faster on both GPU and CPU. It is designed for applications where computational resources are limited or where real-time performance is critical.
And then you'll get something like:
This Model2Vec model is a distilled version of the BAAI/bge-large-en-v1.5 Sentence Transformer that uses static embeddings, allowing text embeddings to be computed orders of magnitude faster on both GPU and CPU. It is designed for applications where computational resources are limited or where real-time performance is critical.
But you do have to then make sure that base_model
exists on the Hub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice suggestion! I updated the model card (added back the distillation part, and implemented your suggestion).
No description provided.