Usage
Install the SC-Embedding package and download this adapter and its base model. Base weights are required separately.
hf download linlp22/SC-Embedding-0.8B --local-dir checkpoints/SC-Embedding-0.8Bhf download Qwen/Qwen3.5-0.8B --local-dir models/Qwen3.5-0.8B
import torchimport torch_npufrom sc_embedding.model import SCEmbedding torch.npu.set_device(0)model = SCEmbedding.from_pretrained( "/path/to/Qwen3.5-0.8B", adapter="/path/to/SC-Embedding-0.8B", device="npu:0",)documents = model.encode_passages([ "Alice moved to Paris.", "She now works at the city hospital.",])queries = model.encode_queries(["Where does Alice work?"])scores = queries @ documents.T
Each passage list is one ordered document or conversation. Queries are encoded independently. Use contextual=False for passages without history. For CUDA, use device="cuda:0" and omit the Ascend import and device selection.
Encoding configuration
- Backbone:
Qwen/Qwen3.5-0.8B.
- History: semantic similarity + BM25 with reciprocal rank fusion (constant 60).
- Context: up to four strictly preceding passages, ordered chronologically, within a 2,048-token history budget.
- Representation: normalized final-token hidden state, with explicit history/passage boundaries.
sc_config.json supplies the inference configuration. This repository contains the LoRA adapter, not the full base model, optimizer state, or a separate teacher.
Checkpoint provenance
This selected existing adapter retains its original fixed-initial-teacher training provenance. The companion repository's training entry point implements online cross-view self-distillation. The exported tensors are unchanged and are not relabeled as outputs of that entry point. See provenance.json for the source policy and checksums.
Adapter SHA-256: 96e16de11a23cfaed3a2787eed19f06d667caaef6dab8ba091f7fe6c20d11a60.
License and acknowledgment
The adapter is distributed under Apache-2.0. Its base model and training data retain their respective licenses. Training builds on EvoEmbedding / EvoTrain-180K, Qwen, Transformers, and PEFT.