Upload folder using huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,19 +1,24 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
| 4 |
-
# LLARA-7B-BEIR
|
| 5 |
|
| 6 |
-
|
| 7 |
|
| 8 |
-
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
## Usage
|
| 13 |
|
| 14 |
-
|
| 15 |
|
| 16 |
-
```
|
| 17 |
import torch
|
| 18 |
from transformers import AutoModel, AutoTokenizer, LlamaModel
|
| 19 |
|
|
@@ -64,8 +69,8 @@ def get_passage_inputs(passages, tokenizer, max_length=512):
|
|
| 64 |
)
|
| 65 |
|
| 66 |
# Load the tokenizer and model
|
| 67 |
-
tokenizer = AutoTokenizer.from_pretrained('
|
| 68 |
-
model = AutoModel.from_pretrained('
|
| 69 |
|
| 70 |
# Define query and passage inputs
|
| 71 |
query = "What is llama?"
|
|
@@ -92,6 +97,27 @@ with torch.no_grad():
|
|
| 92 |
score = query_embedding @ passage_embeddings.T
|
| 93 |
print(score)
|
| 94 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
|
|
|
|
| 96 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
```
|
|
|
|
| 1 |
---
|
| 2 |
+
pipeline_tag: sentence-similarity
|
| 3 |
+
tags:
|
| 4 |
+
- sentence-transformers
|
| 5 |
+
- feature-extraction
|
| 6 |
+
- sentence-similarity
|
| 7 |
+
license: mit
|
| 8 |
---
|
|
|
|
| 9 |
|
| 10 |
+
For more details please refer to our github repo: https://github.com/FlagOpen/FlagEmbedding
|
| 11 |
|
| 12 |
+
# LLARA ([paper](https://arxiv.org/pdf/2312.15503))
|
| 13 |
|
| 14 |
+
In this project, we introduce LLaRA:
|
| 15 |
+
- EBAE: Embedding-Based Auto-Encoding.
|
| 16 |
+
- EBAR: Embedding-Based Auto-Regression.
|
| 17 |
|
|
|
|
| 18 |
|
| 19 |
+
## Usage
|
| 20 |
|
| 21 |
+
```
|
| 22 |
import torch
|
| 23 |
from transformers import AutoModel, AutoTokenizer, LlamaModel
|
| 24 |
|
|
|
|
| 69 |
)
|
| 70 |
|
| 71 |
# Load the tokenizer and model
|
| 72 |
+
tokenizer = AutoTokenizer.from_pretrained('BAAI/LLARA-beir')
|
| 73 |
+
model = AutoModel.from_pretrained('BAAI/LLARA-beir')
|
| 74 |
|
| 75 |
# Define query and passage inputs
|
| 76 |
query = "What is llama?"
|
|
|
|
| 97 |
score = query_embedding @ passage_embeddings.T
|
| 98 |
print(score)
|
| 99 |
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
|
| 103 |
+
## Acknowledgement
|
| 104 |
+
|
| 105 |
+
Thanks to the authors of open-sourced datasets, including MSMARCO, BEIR, etc.
|
| 106 |
+
Thanks to the open-sourced libraries like [Pyserini](https://github.com/castorini/pyserini).
|
| 107 |
+
|
| 108 |
+
|
| 109 |
+
|
| 110 |
+
## Citation
|
| 111 |
|
| 112 |
+
If you find this repository useful, please consider giving a star :star: and citation
|
| 113 |
|
| 114 |
+
```
|
| 115 |
+
@misc{li2023making,
|
| 116 |
+
title={Making Large Language Models A Better Foundation For Dense Retrieval},
|
| 117 |
+
author={Chaofan Li and Zheng Liu and Shitao Xiao and Yingxia Shao},
|
| 118 |
+
year={2023},
|
| 119 |
+
eprint={2312.15503},
|
| 120 |
+
archivePrefix={arXiv},
|
| 121 |
+
primaryClass={cs.CL}
|
| 122 |
+
}
|
| 123 |
```
|
model-00001-of-00006.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4840658560
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d6fccd8125fbe08012de41b19f254477b4fb7653016d54f63a4cf05d6344a058
|
| 3 |
size 4840658560
|
model-00002-of-00006.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4857206856
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2ab32cbdc54b39e8f04666421c5e6ad181b59954cf257a9d131d55ebb16e1268
|
| 3 |
size 4857206856
|
model-00003-of-00006.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4857206904
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9ca1bfeacefd35b9dd1c801c45fa0ad809071faccdd99253e4cf5255cf38ee9b
|
| 3 |
size 4857206904
|
model-00004-of-00006.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4857206904
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0b027c43b746337990b12d3f0f6f7b2c2dc0524cd632738eab22557bc0446be0
|
| 3 |
size 4857206904
|
model-00005-of-00006.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4857206904
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:54890415310f56758951b79a88be1592fba4bd5168053f379c59c4a6e7f1bd25
|
| 3 |
size 4857206904
|
model-00006-of-00006.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 2684734256
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8f8fb6aa36b09ed23b828f92500c76dc784a22511661bd2200e76cf79d9c52a7
|
| 3 |
size 2684734256
|