Views
No views yet
meta-llama/Llama-3.2-1B, trained on MS MARCO with
contrastive + knowledge-distillation loss, an adaptive top-k pruning and a learned per-term threshold. This repository
contains the LoRA adapter (including the learned q_thres/d_thres thresholding modules),
the tokenizer, and the retriever config.1import torch
2from transformers import AutoTokenizer
3from scaling_retriever.modeling.llm_encoder import LlamaBiSparse
4
5model = LlamaBiSparse.load_from_lora("Johonson/adasparse-1B")
6tokenizer = AutoTokenizer.from_pretrained("Johonson/adasparse-1B")
7
8queries = ["What is the capital of France?"]
9passages = ["Paris is the capital of France."]
10
11tokenized_queries = tokenizer(queries, max_length=192, truncation=True,
12 padding="longest", return_tensors="pt")
13tokenized_passages = tokenizer(passages, max_length=192, truncation=True,
14 padding="longest", return_tensors="pt")
15
16query_embeds = model.query_encode(**tokenized_queries)
17doc_embeds = model.doc_encode(**tokenized_passages)
18scores = torch.matmul(query_embeds, doc_embeds.T)meta-llama/Llama-3.2-1B is gated — request access on its model page first.