BAAI / LLARA-passage

huggingface.co
Total runs: 198
24-hour runs: 7
7-day runs: 20
30-day runs: 40
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

198
Total runs
7
24-hour runs
7
3-day runs
20
7-day runs
40
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: 58.5M
Run Growth: -6.0M
Growth Rate: -10.28%
Updated:February 22 2024
huggingface.co

Total runs: 31.9M
Run Growth: -6.2M
Growth Rate: -19.54%
Updated:July 03 2024
huggingface.co

Total runs: 10.1M
Run Growth: -1.8M
Growth Rate: -17.69%
Updated:February 21 2024
huggingface.co

Total runs: 9.0M
Run Growth: -1.5M
Growth Rate: -16.50%
Updated:February 21 2024
huggingface.co

Total runs: 2.4M
Run Growth: -81.8K
Growth Rate: -3.42%
Updated:April 17 2024
huggingface.co

Total runs: 401.4K
Run Growth: -404.7K
Growth Rate: -100.82%
Updated:October 12 2023
huggingface.co

Total runs: 345.7K
Run Growth: -792.7K
Growth Rate: -229.31%
Updated:April 02 2024
huggingface.co

Total runs: 193.7K
Run Growth: -28.3K
Growth Rate: -14.61%
Updated:December 13 2023
huggingface.co

Total runs: 114.7K
Run Growth: 63.2K
Growth Rate: 55.08%
Updated:October 12 2023
huggingface.co

Total runs: 50.0K
Run Growth: -106
Growth Rate: -0.21%
Updated:November 14 2023
huggingface.co

Total runs: 39.4K
Run Growth: -26.5K
Growth Rate: -67.26%
Updated:July 13 2026
huggingface.co

Total runs: 38.4K
Run Growth: -18.2K
Growth Rate: -47.36%
Updated:October 12 2023
huggingface.co

Total runs: 31.9K
Run Growth: -7.7K
Growth Rate: -24.09%
Updated:January 15 2025
huggingface.co

Total runs: 11.7K
Run Growth: -4.1K
Growth Rate: -34.98%
Updated:April 16 2025
huggingface.co

Total runs: 9.9K
Run Growth: -58.8K
Growth Rate: -595.15%
Updated:October 12 2023
huggingface.co

Total runs: 4.0K
Run Growth: -6.7K
Growth Rate: -168.98%
Updated:October 12 2023
huggingface.co

Total runs: 3.3K
Run Growth: -1.5K
Growth Rate: -45.32%
Updated:May 20 2025
huggingface.co

Total runs: 3.0K
Run Growth: -1.9K
Growth Rate: -62.39%
Updated:April 19 2024
huggingface.co

Total runs: 2.0K
Run Growth: 2.0K
Growth Rate: 100.00%
Updated:October 01 2026
huggingface.co

Total runs: 1.7K
Run Growth: -32
Growth Rate: -1.93%
Updated:April 10 2026
huggingface.co

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

Total runs: 1.4K
Run Growth: -2.2K
Growth Rate: -150.35%
Updated:September 11 2026
huggingface.co

Total runs: 1.2K
Run Growth: -850
Growth Rate: -68.16%
Updated:December 31 2022
huggingface.co

Total runs: 1.2K
Run Growth: -577
Growth Rate: -48.77%
Updated:April 10 2026
huggingface.co

Total runs: 1.2K
Run Growth: 322
Growth Rate: 27.88%
Updated:September 16 2026
huggingface.co

Total runs: 1.1K
Run Growth: -559
Growth Rate: -51.66%
Updated:November 28 2024
huggingface.co

Total runs: 760
Run Growth: -33
Growth Rate: -4.41%
Updated:February 07 2024
huggingface.co

Total runs: 736
Run Growth: 721
Growth Rate: 97.96%
Updated:October 13 2025
huggingface.co

Total runs: 517
Run Growth: -13
Growth Rate: -2.51%
Updated:July 13 2026
huggingface.co

Total runs: 498
Run Growth: 292
Growth Rate: 58.63%
Updated:April 02 2024
huggingface.co

Total runs: 476
Run Growth: -550
Growth Rate: -115.55%
Updated:October 23 2024
huggingface.co

Total runs: 468
Run Growth: 38
Growth Rate: 8.12%
Updated:April 18 2023
huggingface.co

Total runs: 448
Run Growth: -316
Growth Rate: -70.54%
Updated:May 23 2025
huggingface.co

Total runs: 445
Run Growth: 120
Growth Rate: 26.97%
Updated:July 13 2026
huggingface.co

Total runs: 441
Run Growth: 29
Growth Rate: 6.58%
Updated:July 13 2026
huggingface.co

Total runs: 422
Run Growth: 178
Growth Rate: 42.18%
Updated:December 25 2025
huggingface.co

Total runs: 419
Run Growth: 36
Growth Rate: 8.59%
Updated:October 27 2023
huggingface.co

Total runs: 415
Run Growth: 129
Growth Rate: 31.01%
Updated:March 07 2024
huggingface.co

Total runs: 392
Run Growth: -640
Growth Rate: -163.27%
Updated:October 24 2024
huggingface.co

Total runs: 382
Run Growth: 33
Growth Rate: 8.64%
Updated:August 11 2026
huggingface.co

Total runs: 378
Run Growth: 5
Growth Rate: 1.32%
Updated:August 11 2026
huggingface.co

Total runs: 364
Run Growth: 159
Growth Rate: 43.68%
Updated:July 13 2026
huggingface.co

Total runs: 298
Run Growth: 52
Growth Rate: 17.45%
Updated:August 18 2026
huggingface.co

Total runs: 290
Run Growth: -36
Growth Rate: -12.41%
Updated:July 13 2026
huggingface.co

Total runs: 286
Run Growth: -203
Growth Rate: -70.98%
Updated:April 10 2026
huggingface.co

Total runs: 273
Run Growth: 61
Growth Rate: 22.34%
Updated:July 13 2026
huggingface.co

Total runs: 272
Run Growth: 45
Growth Rate: 16.54%
Updated:June 06 2025
huggingface.co

Total runs: 268
Run Growth: 84
Growth Rate: 31.34%
Updated:July 13 2026
huggingface.co

Total runs: 259
Run Growth: -31
Growth Rate: -11.97%
Updated:July 13 2026
huggingface.co

Total runs: 251
Run Growth: 101
Growth Rate: 40.24%
Updated:November 28 2023
huggingface.co

Total runs: 243
Run Growth: -68
Growth Rate: -27.98%
Updated:December 25 2025
huggingface.co

Total runs: 242
Run Growth: 65
Growth Rate: 26.86%
Updated:October 23 2024
huggingface.co

Total runs: 231
Run Growth: 67
Growth Rate: 29.00%
Updated:July 13 2026
huggingface.co

Total runs: 216
Run Growth: 83
Growth Rate: 38.43%
Updated:July 13 2026
huggingface.co

Total runs: 215
Run Growth: -7
Growth Rate: -3.26%
Updated:July 17 2026
huggingface.co

Total runs: 200
Run Growth: 28
Growth Rate: 14.00%
Updated:June 24 2024
huggingface.co

Total runs: 194
Run Growth: 34
Growth Rate: 17.53%
Updated:May 13 2024
huggingface.co

Total runs: 193
Run Growth: 40
Growth Rate: 20.73%
Updated:May 13 2024
huggingface.co

Total runs: 191
Run Growth: 41
Growth Rate: 21.47%
Updated:June 24 2024
huggingface.co

Total runs: 191
Run Growth: 38
Growth Rate: 19.90%
Updated:May 31 2024
huggingface.co

Total runs: 188
Run Growth: 45
Growth Rate: 23.94%
Updated:December 21 2023
huggingface.co

Total runs: 185
Run Growth: 41
Growth Rate: 22.16%
Updated:December 21 2023
huggingface.co

Total runs: 181
Run Growth: 35
Growth Rate: 19.55%
Updated:July 02 2024