Edit model card

SentenceTransformer based on meta-llama/Llama-3.2-1B

This is a sentence-transformers model finetuned from meta-llama/Llama-3.2-1B. It maps sentences & paragraphs to a 2048-dimensional dense vector space and can be used for semantic textual similarity, semantic search, paraphrase mining, text classification, clustering, and more.

Model Details

Model Description

  • Model Type: Sentence Transformer
  • Base model: meta-llama/Llama-3.2-1B
  • Maximum Sequence Length: 512 tokens
  • Output Dimensionality: 2048 tokens
  • Similarity Function: Cosine Similarity

Model Sources

Full Model Architecture

SentenceTransformer(
  (0): Transformer({'max_seq_length': 512, 'do_lower_case': False}) with Transformer model: LlamaModel 
  (1): Pooling({'word_embedding_dimension': 2048, 'pooling_mode_cls_token': False, 'pooling_mode_mean_tokens': True, 'pooling_mode_max_tokens': False, 'pooling_mode_mean_sqrt_len_tokens': False, 'pooling_mode_weightedmean_tokens': False, 'pooling_mode_lasttoken': False, 'include_prompt': True})
  (2): Normalize()
)

Usage

Direct Usage (Sentence Transformers)

First install the Sentence Transformers library:

pip install -U sentence-transformers

Then you can load this model and run inference.

from sentence_transformers import SentenceTransformer

# Download from the 🤗 Hub
model = SentenceTransformer("roboepicss/merged_product_stage_1_llama1B")
# Run inference
sentences = [
    'The weather is lovely today.',
    "It's so sunny outside!",
    'He drove to the stadium.',
]
embeddings = model.encode(sentences)
print(embeddings.shape)
# [3, 2048]

# Get the similarity scores for the embeddings
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]

Evaluation

Metrics

Information Retrieval

Metric Value
cosine_accuracy@1 0.7918
cosine_accuracy@3 0.9296
cosine_accuracy@5 0.9589
cosine_accuracy@10 0.9825
cosine_precision@1 0.7918
cosine_precision@3 0.3099
cosine_precision@5 0.1918
cosine_precision@10 0.0983
cosine_recall@1 0.0855
cosine_recall@3 0.1003
cosine_recall@5 0.1035
cosine_recall@10 0.106
cosine_ndcg@10 0.2064
cosine_mrr@10 0.8654
cosine_map@100 0.0935
dot_accuracy@1 0.7918
dot_accuracy@3 0.9296
dot_accuracy@5 0.9589
dot_accuracy@10 0.9825
dot_precision@1 0.7918
dot_precision@3 0.3099
dot_precision@5 0.1918
dot_precision@10 0.0983
dot_recall@1 0.0855
dot_recall@3 0.1003
dot_recall@5 0.1035
dot_recall@10 0.106
dot_ndcg@10 0.2064
dot_mrr@10 0.8654
dot_map@100 0.0935

Training Details

Training Logs

Epoch Step ir_cosine_map@100
0 0 0.0935

Framework Versions

  • Python: 3.10.12
  • Sentence Transformers: 3.2.0
  • Transformers: 4.44.2
  • PyTorch: 2.4.1+cu121
  • Accelerate: 0.34.2
  • Datasets: 3.0.1
  • Tokenizers: 0.19.1

Citation

BibTeX

Downloads last month
202
Safetensors
Model size
1.24B params
Tensor type
F32
·
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.

Model tree for roboepicss/merged_product_stage_1_llama1B

Finetuned
(95)
this model

Evaluation results