File size: 886 Bytes
50577a3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f1a0a9c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# BioLLM2Vec

This repository contains the model weights for the sentence-to-vector embedding model used in BioLitGPT. The main github repository is at https://github.com/jeffreyzhang92/BioLitGPT.

Basic usage:

```
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")
```

You will also require access to the Meta LLaMA repository to load the model: https://huggingface.co/meta-llama
```
from huggingface_hub import login
login("insert_hf_access_token_here")
```