---
language:
- en
tags:
- sentence-transformers
- sentence-similarity
- feature-extraction
- generated_from_trainer
- dataset_size:100000
- loss:MultipleNegativesRankingLoss
base_model: unsloth/all-MiniLM-L6-v2
widget:
- source_sentence: the three boys are all holding onto a flotation device in the water.
sentences:
- Three boys are in a body of water.
- A school band is playing.
- There is an animal in water
- source_sentence: A man on a street in a bright t-shirt holds some sort of tablet
towards a woman in a pink t-shirt and shades.
sentences:
- A man is showing a woman something
- People are outside in the snow.
- Cheerleaders cheer on a field for an activity.
- source_sentence: A young woman is drawing with a Sharpie marker.
sentences:
- A car is flooding.
- The woman is drawing
- A dog with an object in it's mouth is in the water.
- source_sentence: A baseball player is putting all his might in to throwing a ball.
sentences:
- There are people at work.
- One man with a bat wearing red and white.
- Pitcher is winding up a throw
- source_sentence: Five men, one wearing a white shirt standing on something, hanging
up a picture of a child.
sentences:
- The people are outdoors eating and drinking.
- Two workers are opening a utility box.
- A group of men are hanging a picture on a wall.
datasets:
- sentence-transformers/all-nli
pipeline_tag: sentence-similarity
library_name: sentence-transformers
---
# SentenceTransformer based on unsloth/all-MiniLM-L6-v2
This is a [sentence-transformers](https://www.SBERT.net) model finetuned from [unsloth/all-MiniLM-L6-v2](https://huggingface.co/unsloth/all-MiniLM-L6-v2) on the [all-nli](https://huggingface.co/datasets/sentence-transformers/all-nli) dataset. It maps sentences & paragraphs to a 384-dimensional dense vector space and can be used for retrieval.
## Model Details
### Model Description
- **Model Type:** Sentence Transformer
- **Base model:** [unsloth/all-MiniLM-L6-v2](https://huggingface.co/unsloth/all-MiniLM-L6-v2)
- **Maximum Sequence Length:** 256 tokens
- **Output Dimensionality:** 384 dimensions
- **Similarity Function:** Cosine Similarity
- **Supported Modality:** Text
- **Training Dataset:**
- [all-nli](https://huggingface.co/datasets/sentence-transformers/all-nli)
- **Language:** en
### Model Sources
- **Documentation:** [Sentence Transformers Documentation](https://sbert.net)
- **Repository:** [Sentence Transformers on GitHub](https://github.com/huggingface/sentence-transformers)
- **Hugging Face:** [Sentence Transformers on Hugging Face](https://huggingface.co/models?library=sentence-transformers)
### Full Model Architecture
```
SentenceTransformer(
(0): Transformer({'transformer_task': 'feature-extraction', 'modality_config': {'text': {'method': 'forward', 'method_output_name': 'last_hidden_state'}}, 'module_output_name': 'token_embeddings', 'architecture': 'PeftModelForFeatureExtraction'})
(1): Pooling({'embedding_dimension': 384, 'pooling_mode': 'mean', 'include_prompt': True})
(2): Normalize({})
)
```
## Usage
### Direct Usage (Sentence Transformers)
First install the Sentence Transformers library:
```bash
pip install -U sentence-transformers
```
Then you can load this model and run inference.
```python
from sentence_transformers import SentenceTransformer
# Download from the 🤗 Hub
model = SentenceTransformer("jaswanthsanjay88/mini_embedding_lora")
# Run inference
sentences = [
'Five men, one wearing a white shirt standing on something, hanging up a picture of a child.',
'A group of men are hanging a picture on a wall.',
'Two workers are opening a utility box.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 384]
# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities)
# tensor([[1.0000, 0.6383, 0.0003],
# [0.6383, 1.0000, 0.0730],
# [0.0003, 0.0730, 1.0000]])
```
## Training Details
### Training Dataset
#### all-nli
* Dataset: [all-nli](https://huggingface.co/datasets/sentence-transformers/all-nli) at [d482672](https://huggingface.co/datasets/sentence-transformers/all-nli/tree/d482672c8e74ce18da116f430137434ba2e52fab)
* Size: 100,000 training samples
* Columns: anchor and positive
* Approximate statistics based on the first 100 samples:
| | anchor | positive |
|:---------|:---------------------------------------------------------------------------------|:----------------------------------------------------------------------------------|
| type | string | string |
| modality | text | text |
| details |
A person on a horse jumps over a broken down airplane. | A person is outdoors, on a horse. |
| Children smiling and waving at camera | There are children present |
| A boy is jumping on skateboard in the middle of a red bridge. | The boy does a skateboarding trick. |
* Loss: [MultipleNegativesRankingLoss](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#multiplenegativesrankingloss) with these parameters:
```json
{
"scale": 20.0,
"similarity_fct": "cos_sim",
"gather_across_devices": false,
"directions": [
"query_to_doc"
],
"partition_mode": "joint",
"hardness_mode": null,
"hardness_strength": 0.0
}
```
### Training Hyperparameters
#### Non-Default Hyperparameters
- `per_device_train_batch_size`: 256
- `learning_rate`: 0.0002
- `num_train_epochs`: 2
- `warmup_ratio`: 0.03
- `fp16`: True
- `batch_sampler`: no_duplicates
#### All Hyperparameters