DinoStackAI/narrativeqa-rag
Viewer • Updated • 610k • 98
How to use DinoStackAI/Qwen3-Emb-4b-lora-narrativeqa with sentence-transformers:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("DinoStackAI/Qwen3-Emb-4b-lora-narrativeqa")
sentences = [
"The weather is lovely today.",
"It's so sunny outside!",
"He drove to the stadium."
]
embeddings = model.encode(sentences)
similarities = model.similarity(embeddings, embeddings)
print(similarities.shape)
# [3, 3]How to use DinoStackAI/Qwen3-Emb-4b-lora-narrativeqa with PEFT:
Task type is invalid.
LoRA adapter for Qwen/Qwen3-Embedding-4B fine-tuned on the narrativeqa RAG retrieval dataset (DinoStackAI/narrativeqa-rag).
eval_narrativeqa-dev_cosine_ndcg@10 = 0.8110from sentence_transformers import SentenceTransformer
model = SentenceTransformer("DinoStackAI/Qwen3-Emb-4b-lora-narrativeqa")
embeddings = model.encode(["Instruct: ...\nQuery:your query", "document text"])
Or load the base model and adapter explicitly:
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("Qwen/Qwen3-Embedding-4B")
model.load_adapter("DinoStackAI/Qwen3-Emb-4b-lora-narrativeqa")
from vllm import LLM
from vllm.lora.request import LoRARequest
llm = LLM(
model="Qwen/Qwen3-Embedding-4B",
task="embed",
enable_lora=True,
max_lora_rank=16,
)
outputs = llm.embed(
["Instruct: ...\nQuery:your query"],
lora_request=LoRARequest("narrativeqa", 1, "DinoStackAI/Qwen3-Emb-4b-lora-narrativeqa"),
)
Qwen/Qwen3-Embedding-4BDinoStackAI/narrativeqa-ragr=16, lora_alpha=32, targets q_proj / v_proj)