BAAI / LLARA-passage

huggingface.co
Total runs: 179
24-hour runs: -2
7-day runs: -14
30-day runs: -166
Model's Last Updated: May 13 2024
sentence-similarity

Introduction of LLARA-passage

Model Details of LLARA-passage

For more details please refer to our github repo: https://github.com/FlagOpen/FlagEmbedding

LLARA ( paper )

In this project, we introduce LLaRA:

  • EBAE: Embedding-Based Auto-Encoding.
  • EBAR: Embedding-Based Auto-Regression.
Usage
import torch
from transformers import AutoModel, AutoTokenizer, LlamaModel

def get_query_inputs(queries, tokenizer, max_length=512):
    prefix = '"'
    suffix = '", predict the following passage within eight words: <s9><s10><s11><s12><s13><s14><s15><s16>'
    prefix_ids = tokenizer(prefix, return_tensors=None)['input_ids']
    suffix_ids = tokenizer(suffix, return_tensors=None)['input_ids'][1:]
    queries_inputs = []
    for query in queries:
        inputs = tokenizer(query,
                           return_tensors=None,
                           max_length=max_length,
                           truncation=True,
                           add_special_tokens=False)
        inputs['input_ids'] = prefix_ids + inputs['input_ids'] + suffix_ids
        inputs['attention_mask'] = [1] * len(inputs['input_ids'])
        queries_inputs.append(inputs)
    return tokenizer.pad(
            queries_inputs,
            padding=True,
            max_length=max_length,
            pad_to_multiple_of=8,
            return_tensors='pt',
        )

def get_passage_inputs(passages, tokenizer, max_length=512):
    prefix = '"'
    suffix = '", summarize the above passage within eight words: <s1><s2><s3><s4><s5><s6><s7><s8>'
    prefix_ids = tokenizer(prefix, return_tensors=None)['input_ids']
    suffix_ids = tokenizer(suffix, return_tensors=None)['input_ids'][1:]
    passages_inputs = []
    for passage in passages:
        inputs = tokenizer(passage,
                           return_tensors=None,
                           max_length=max_length,
                           truncation=True,
                           add_special_tokens=False)
        inputs['input_ids'] = prefix_ids + inputs['input_ids'] + suffix_ids
        inputs['attention_mask'] = [1] * len(inputs['input_ids'])
        passages_inputs.append(inputs)
    return tokenizer.pad(
            passages_inputs,
            padding=True,
            max_length=max_length,
            pad_to_multiple_of=8,
            return_tensors='pt',
        )

# Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained('BAAI/LLARA-passage')
model = AutoModel.from_pretrained('BAAI/LLARA-passage')

# Define query and passage inputs
query = "What is llama?"
title = "Llama"
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."
query_input = get_query_inputs([query], tokenizer)
passage_input = get_passage_inputs([passage], tokenizer)


with torch.no_grad():
    # compute query embedding
    query_outputs = model(**query_input, return_dict=True, output_hidden_states=True)
    query_embedding = query_outputs.hidden_states[-1][:, -8:, :]
    query_embedding = torch.mean(query_embedding, dim=1)
    query_embedding = torch.nn.functional.normalize(query_embedding, dim=-1)

    # compute passage embedding
    passage_outputs = model(**passage_input, return_dict=True, output_hidden_states=True)
    passage_embeddings = passage_outputs.hidden_states[-1][:, -8:, :]
    passage_embeddings = torch.mean(passage_embeddings, dim=1)
    passage_embeddings = torch.nn.functional.normalize(passage_embeddings, dim=-1)

    # compute similarity score
    score = query_embedding @ passage_embeddings.T
    print(score)
Acknowledgement

Thanks to the authors of open-sourced datasets, including MSMARCO, BEIR, etc. Thanks to the open-sourced libraries like Pyserini .

Citation

If you find this repository useful, please consider giving a star :star: and citation

@misc{li2023making,
      title={Making Large Language Models A Better Foundation For Dense Retrieval}, 
      author={Chaofan Li and Zheng Liu and Shitao Xiao and Yingxia Shao},
      year={2023},
      eprint={2312.15503},
      archivePrefix={arXiv},
      primaryClass={cs.CL}
}

Runs of BAAI LLARA-passage on huggingface.co

179
Total runs
-2
24-hour runs
18
3-day runs
-14
7-day runs
-166
30-day runs

More Information About LLARA-passage huggingface.co Model

More LLARA-passage license Visit here:

https://choosealicense.com/licenses/mit

LLARA-passage huggingface.co

LLARA-passage huggingface.co is an AI model on huggingface.co that provides LLARA-passage's model effect (), which can be used instantly with this BAAI LLARA-passage model. huggingface.co supports a free trial of the LLARA-passage model, and also provides paid use of the LLARA-passage. Support call LLARA-passage model through api, including Node.js, Python, http.

LLARA-passage huggingface.co Url

https://huggingface.co/BAAI/LLARA-passage

BAAI LLARA-passage online free

LLARA-passage huggingface.co is an online trial and call api platform, which integrates LLARA-passage's modeling effects, including api services, and provides a free online trial of LLARA-passage, you can try LLARA-passage online for free by clicking the link below.

BAAI LLARA-passage online free url in huggingface.co:

https://huggingface.co/BAAI/LLARA-passage

LLARA-passage install

LLARA-passage is an open source model from GitHub that offers a free installation service, and any user can find LLARA-passage on GitHub to install. At the same time, huggingface.co provides the effect of LLARA-passage install, users can directly use LLARA-passage installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

LLARA-passage install url in huggingface.co:

https://huggingface.co/BAAI/LLARA-passage

Url of LLARA-passage

LLARA-passage huggingface.co Url

Provider of LLARA-passage huggingface.co

BAAI
ORGANIZATIONS

Other API from BAAI

huggingface.co

Total runs: 64.6M
Run Growth: -2.5M
Growth Rate: -3.89%
Updated:February 22 2024
huggingface.co

Total runs: 37.8M
Run Growth: 5.6M
Growth Rate: 14.76%
Updated:July 03 2024
huggingface.co

Total runs: 10.7M
Run Growth: 658.2K
Growth Rate: 6.16%
Updated:February 21 2024
huggingface.co

Total runs: 2.2M
Run Growth: 1.7M
Growth Rate: 77.73%
Updated:April 17 2024
huggingface.co

Total runs: 799.8K
Run Growth: -706.1K
Growth Rate: -88.29%
Updated:October 12 2023
huggingface.co

Total runs: 246.7K
Run Growth: -1.3M
Growth Rate: -507.77%
Updated:December 13 2023
huggingface.co

Total runs: 68.1K
Run Growth: 10.0K
Growth Rate: 14.70%
Updated:July 13 2026
huggingface.co

Total runs: 60.6K
Run Growth: -109.9K
Growth Rate: -181.17%
Updated:October 12 2023
huggingface.co

Total runs: 49.6K
Run Growth: -42.6K
Growth Rate: -85.91%
Updated:October 12 2023
huggingface.co

Total runs: 45.9K
Run Growth: 20.8K
Growth Rate: 45.23%
Updated:November 14 2023
huggingface.co

Total runs: 37.5K
Run Growth: -23.4K
Growth Rate: -62.50%
Updated:January 15 2025
huggingface.co

Total runs: 36.7K
Run Growth: 13.5K
Growth Rate: 36.92%
Updated:October 12 2023
huggingface.co

Total runs: 16.0K
Run Growth: 3.1K
Growth Rate: 19.41%
Updated:April 16 2025
huggingface.co

Total runs: 11.6K
Run Growth: -13.6K
Growth Rate: -116.76%
Updated:October 12 2023
huggingface.co

Total runs: 5.5K
Run Growth: 4.9K
Growth Rate: 89.20%
Updated:April 19 2024
huggingface.co

Total runs: 4.6K
Run Growth: -10.5K
Growth Rate: -231.70%
Updated:May 20 2025
huggingface.co

Total runs: 3.1K
Run Growth: 2.2K
Growth Rate: 69.80%
Updated:September 11 2026
huggingface.co

Total runs: 1.8K
Run Growth: 990
Growth Rate: 54.70%
Updated:December 31 2022
huggingface.co

Total runs: 1.6K
Run Growth: -13.4K
Growth Rate: -855.43%
Updated:January 15 2025
huggingface.co

Total runs: 1.4K
Run Growth: -859
Growth Rate: -59.61%
Updated:April 10 2026
huggingface.co

Total runs: 1.4K
Run Growth: -851
Growth Rate: -61.31%
Updated:April 10 2026
huggingface.co

Total runs: 1.3K
Run Growth: 259
Growth Rate: 20.72%
Updated:September 11 2026
huggingface.co

Total runs: 1.2K
Run Growth: 685
Growth Rate: 56.43%
Updated:October 23 2024
huggingface.co

Total runs: 1.2K
Run Growth: -536
Growth Rate: -46.33%
Updated:November 28 2024
huggingface.co

Total runs: 1.1K
Run Growth: 205
Growth Rate: 16.47%
Updated:February 07 2024
huggingface.co

Total runs: 1.0K
Run Growth: 733
Growth Rate: 70.28%
Updated:October 24 2024
huggingface.co

Total runs: 876
Run Growth: 234
Growth Rate: 26.71%
Updated:May 23 2025
huggingface.co

Total runs: 579
Run Growth: -261
Growth Rate: -45.08%
Updated:July 13 2026
huggingface.co

Total runs: 470
Run Growth: 186
Growth Rate: 39.57%
Updated:April 10 2026
huggingface.co

Total runs: 467
Run Growth: -81
Growth Rate: -17.34%
Updated:July 13 2026
huggingface.co

Total runs: 460
Run Growth: -700
Growth Rate: -152.17%
Updated:April 18 2023
huggingface.co

Total runs: 429
Run Growth: -107
Growth Rate: -24.94%
Updated:October 27 2023
huggingface.co

Total runs: 398
Run Growth: -544
Growth Rate: -136.68%
Updated:August 11 2026
huggingface.co

Total runs: 389
Run Growth: -242
Growth Rate: -62.21%
Updated:December 25 2025
huggingface.co

Total runs: 388
Run Growth: -6
Growth Rate: -1.55%
Updated:August 11 2026
huggingface.co

Total runs: 313
Run Growth: 22
Growth Rate: 7.03%
Updated:July 13 2026
huggingface.co

Total runs: 306
Run Growth: 139
Growth Rate: 45.42%
Updated:July 13 2026
huggingface.co

Total runs: 302
Run Growth: -3.4K
Growth Rate: -1128.48%
Updated:April 10 2026
huggingface.co

Total runs: 290
Run Growth: -77
Growth Rate: -26.01%
Updated:March 07 2024
huggingface.co

Total runs: 286
Run Growth: 218
Growth Rate: 76.22%
Updated:August 18 2026
huggingface.co

Total runs: 285
Run Growth: -602
Growth Rate: -211.23%
Updated:December 25 2025
huggingface.co

Total runs: 279
Run Growth: 60
Growth Rate: 21.51%
Updated:July 13 2026
huggingface.co

Total runs: 279
Run Growth: -11
Growth Rate: -3.94%
Updated:April 10 2026
huggingface.co

Total runs: 254
Run Growth: 10
Growth Rate: 3.94%
Updated:February 11 2025
huggingface.co

Total runs: 213
Run Growth: -70
Growth Rate: -32.86%
Updated:June 06 2025
huggingface.co

Total runs: 213
Run Growth: 37
Growth Rate: 17.37%
Updated:July 13 2026
huggingface.co

Total runs: 210
Run Growth: -145
Growth Rate: -69.05%
Updated:July 17 2026
huggingface.co

Total runs: 209
Run Growth: -82
Growth Rate: -39.23%
Updated:October 23 2024
huggingface.co

Total runs: 202
Run Growth: -65
Growth Rate: -32.18%
Updated:July 13 2026
huggingface.co

Total runs: 185
Run Growth: -102
Growth Rate: -55.14%
Updated:July 13 2026
huggingface.co

Total runs: 181
Run Growth: 34
Growth Rate: 18.78%
Updated:April 02 2024
huggingface.co

Total runs: 176
Run Growth: -38
Growth Rate: -21.59%
Updated:April 10 2026
huggingface.co

Total runs: 167
Run Growth: 89
Growth Rate: 53.29%
Updated:August 23 2023
huggingface.co

Total runs: 166
Run Growth: -30
Growth Rate: -18.07%
Updated:May 13 2024
huggingface.co

Total runs: 165
Run Growth: -31
Growth Rate: -18.79%
Updated:May 13 2024
huggingface.co

Total runs: 165
Run Growth: -36
Growth Rate: -21.82%
Updated:May 31 2024
huggingface.co

Total runs: 160
Run Growth: -1.1K
Growth Rate: -701.88%
Updated:June 24 2024
huggingface.co

Total runs: 153
Run Growth: -44
Growth Rate: -28.76%
Updated:July 13 2026
huggingface.co

Total runs: 147
Run Growth: 147
Growth Rate: 100.00%
Updated:September 05 2026
huggingface.co

Total runs: 144
Run Growth: -94
Growth Rate: -65.28%
Updated:July 13 2026
huggingface.co

Total runs: 137
Run Growth: 34
Growth Rate: 25.19%
Updated:July 02 2024
huggingface.co

Total runs: 136
Run Growth: -41
Growth Rate: -30.15%
Updated:July 13 2026