Skip to content
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

Merged
merged 4 commits into from
Sep 27, 2024

Conversation

stephantul
Copy link
Collaborator

No description provided.

@stephantul stephantul requested a review from Pringled September 26, 2024 09:14
Comment on lines 31 to 44
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")
```

Copy link
Contributor

@tomaarsen tomaarsen Sep 26, 2024

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.

Copy link
Member

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).

@Pringled Pringled merged commit 2f09539 into main Sep 27, 2024
@Pringled Pringled deleted the make_token_optional_and_private_an_argument branch September 27, 2024 08:03
@stephantul stephantul mentioned this pull request Sep 28, 2024
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants