Views
No views yet
import torch
from llm2vec import LLM2Vec
model = LLM2Vec.from_pretrained("McGill-NLP/LLM2Vec-Meta-Llama-3-8B-Instruct-mntp",
peft_model_name_or_path="YBXL/BioLLM2Vec",
device_map="cuda" if torch.cuda.is_available() else "cpu",
torch_dtype=torch.bfloat16,
revision="main"
)
embedding = model.encode("This is a sentence")from huggingface_hub import login
login("insert_hf_access_token_here")