Downloads · 30 days
0
AnkitSatpute/Llama-3.1-ReRank-AllFTbtAbstr
Llama-3.1-ReRank-AllFTbtAbstr is a text classification model from AnkitSatpute. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as mit.
The model is trained to generate document embeddings for math research papers and use the embeddings to find similar ranked documents.
Downloads · 30 days
0
Access
Public
Updated Nov 28, 2024
Repo size
54.6 MB
Likes
0
Public
Click a slice to open those files.
.safetensors54.6 MB · 86%
From the Hugging Face model README
The model is trained to generate document embeddings for math research papers and use the embeddings to find similar ranked documents.
LLaMa model that is trained with contrastive learning for sequence classification.
from transformers import AutoTokenizer, AutoModel import torch
sentences = ["Hello Who are you?", "I am fine thank you"]
tokenizer = AutoTokenizer.from_pretrained('AnkitSatpute/Llama-3.1-ReRank-AllFTbtAbstr')
model = AutoModel.from_pretrained('AnkitSatpute/Llama-3.1-ReRank-AllFTbtAbstr')
model.eval()
with torch.no_grad():
model_output = model(**encoded_input)
sentence_embeddings = model_output[0][:, 0]
sentence_embeddings = torch.nn.functional.normalize(sentence_embeddings, p=2, dim=1)
print("Sentence embeddings:", sentence_embeddings)