Update README.md
Browse files
README.md
CHANGED
@@ -10,6 +10,11 @@ Xueguang Ma, Liang Wang, Nan Yang, Furu Wei, Jimmy Lin, arXiv 2023
|
|
10 |
|
11 |
This model is fine-tuned from LLaMA-2-7B using LoRA for passage reranking.
|
12 |
|
|
|
|
|
|
|
|
|
|
|
13 |
## Usage
|
14 |
|
15 |
Below is an example to compute the similarity score of a query-passage pair
|
@@ -31,13 +36,13 @@ def get_model(peft_model_name):
|
|
31 |
tokenizer = AutoTokenizer.from_pretrained('meta-llama/Llama-2-7b-hf')
|
32 |
model = get_model('castorini/rankllama-v1-7b-lora-passage')
|
33 |
|
34 |
-
# Define a query-
|
35 |
query = "What is llama?"
|
36 |
title = "Llama"
|
37 |
-
|
38 |
|
39 |
-
# Tokenize the query-
|
40 |
-
inputs = tokenizer(f'query: {query}', f'document: {title} {
|
41 |
|
42 |
# Run the model forward
|
43 |
with torch.no_grad():
|
|
|
10 |
|
11 |
This model is fine-tuned from LLaMA-2-7B using LoRA for passage reranking.
|
12 |
|
13 |
+
## Training Data
|
14 |
+
The model is fine-tuned on the training split of [MS MARCO Passage Ranking](https://microsoft.github.io/msmarco/Datasets) datasets for 1 epoch.
|
15 |
+
Please check our paper for details.
|
16 |
+
|
17 |
+
|
18 |
## Usage
|
19 |
|
20 |
Below is an example to compute the similarity score of a query-passage pair
|
|
|
36 |
tokenizer = AutoTokenizer.from_pretrained('meta-llama/Llama-2-7b-hf')
|
37 |
model = get_model('castorini/rankllama-v1-7b-lora-passage')
|
38 |
|
39 |
+
# Define a query-passage pair
|
40 |
query = "What is llama?"
|
41 |
title = "Llama"
|
42 |
+
passage = "The llama is a domesticated South American camelid, widely used as a meat and pack animal by Andean cultures since the pre-Columbian era."
|
43 |
|
44 |
+
# Tokenize the query-passage pair
|
45 |
+
inputs = tokenizer(f'query: {query}', f'document: {title} {passage}</s>', return_tensors='pt')
|
46 |
|
47 |
# Run the model forward
|
48 |
with torch.no_grad():
|