Run this model with HF Jobs
Run avivst/our_carbohydrate_data_upsample_classifier on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/avivst/our_carbohydrate_data_upsample_classifier. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/avivst/our_carbohydrate_data_upsample_classifier on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Instructions to use avivst/our_carbohydrate_data_upsample_classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Model2Vec
How to use avivst/our_carbohydrate_data_upsample_classifier with Model2Vec:
from model2vec import StaticModel model = StaticModel.from_pretrained("avivst/our_carbohydrate_data_upsample_classifier") embeddings = model.encode(["It's dangerous to go alone!", "It's a secret to everybody."]) print(embeddings.shape) - sentence-transformers
How to use avivst/our_carbohydrate_data_upsample_classifier with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("avivst/our_carbohydrate_data_upsample_classifier") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub
Browse filesFiles changed (7)
- .gitattributes+1
- README.mdAdded+98
- config.jsonAdded+3
- model.safetensorsAdded+3
- modules.jsonAdded+14
- pipeline.skopsAdded+3
- tokenizer.jsonAdded
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines3334353632 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textpipeline.skops filter=lfs diff=lfs merge=lfs -text
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798---base_model: unknownlibrary_name: model2veclicense: mitmodel_name: tmp8x10imwitags:- embeddings- static-embeddings- sentence-transformers---
# tmp8x10imwi Model Card
This [Model2Vec](https://github.com/MinishLab/model2vec) model is a distilled version of the unknown(https://huggingface.co/unknown) Sentence Transformer. It 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. Model2Vec models are the smallest, fastest, and most performant static embedders available. The distilled models are up to 50 times smaller and 500 times faster than traditional Sentence Transformers.
## Installation
Install model2vec using pip:```pip install model2vec```
## Usage
### Using Model2Vec
The [Model2Vec library](https://github.com/MinishLab/model2vec) is the fastest and most lightweight way to run Model2Vec models.
Load this model using the `from_pretrained` method:```pythonfrom model2vec import StaticModel
# Load a pretrained Model2Vec modelmodel = StaticModel.from_pretrained("tmp8x10imwi")
# Compute text embeddingsembeddings = model.encode(["Example sentence"])```
### Using Sentence Transformers
You can also use the [Sentence Transformers library](https://github.com/UKPLab/sentence-transformers) to load and use the model:
```pythonfrom sentence_transformers import SentenceTransformer
# Load a pretrained Sentence Transformer modelmodel = SentenceTransformer("tmp8x10imwi")
# Compute text embeddingsembeddings = model.encode(["Example sentence"])```
### Distilling a Model2Vec model
You can distill a Model2Vec model from a Sentence Transformer model using the `distill` method. First, install the `distill` extra with `pip install model2vec[distill]`. Then, run the following code:
```pythonfrom model2vec.distill import distill
# Distill a Sentence Transformer model, in this case the BAAI/bge-base-en-v1.5 modelm2v_model = distill(model_name="BAAI/bge-base-en-v1.5", pca_dims=256)
# Save the modelm2v_model.save_pretrained("m2v_model")```
## How it works
Model2vec creates a small, fast, and powerful model that outperforms other static embedding models by a large margin on all tasks we could find, while being much faster to create than traditional static embedding models such as GloVe. Best of all, you don't need any data to distill a model using Model2Vec.
It works by passing a vocabulary through a sentence transformer model, then reducing the dimensionality of the resulting embeddings using PCA, and finally weighting the embeddings using [SIF weighting](https://openreview.net/pdf?id=SyK00v5xx). During inference, we simply take the mean of all token embeddings occurring in a sentence.
## Additional Resources
- [Model2Vec Repo](https://github.com/MinishLab/model2vec)- [Model2Vec Base Models](https://huggingface.co/collections/minishlab/model2vec-base-models-66fd9dd9b7c3b3c0f25ca90e)- [Model2Vec Results](https://github.com/MinishLab/model2vec/tree/main/results)- [Model2Vec Tutorials](https://github.com/MinishLab/model2vec/tree/main/tutorials)- [Website](https://minishlab.github.io/)
## Library Authors
Model2Vec was developed by the [Minish Lab](https://github.com/MinishLab) team consisting of [Stephan Tulkens](https://github.com/stephantul) and [Thomas van Dongen](https://github.com/Pringled).
## Citation
Please cite the [Model2Vec repository](https://github.com/MinishLab/model2vec) if you use this model in your work.```@article{minishlab2024model2vec, author = {Tulkens, Stephan and {van Dongen}, Thomas}, title = {Model2Vec: Fast State-of-the-Art Static Embeddings}, year = {2024}, url = {https://github.com/MinishLab/model2vec}}```123{ "normalize": true}123version https://git-lfs.github.com/spec/v1oid sha256:1ecd722a0a098fc76482b08b6042e6118dc1dfff47937c6b41bc7687721035a0size 6211339201234567891011121314[ { "idx": 0, "name": "0", "path": ".", "type": "sentence_transformers.models.StaticEmbedding" }, { "idx": 1, "name": "1", "path": "1_Normalize", "type": "sentence_transformers.models.Normalize" }]123version https://git-lfs.github.com/spec/v1oid sha256:fb9601d7f7d5ebebe2a4cedffd02faba35f725df0edc5ff34ed8fbdb3340850fsize 22161563.gitattributes+1
README.mdAdded+98
config.jsonAdded+3
model.safetensorsAdded+3
modules.jsonAdded+14
pipeline.skopsAdded+3
tokenizer.jsonAdded