Downloads · 30 days
0
cs4248-nlp/control-supervised-all-minilm-l6-v2-taco-20260326-110508
control-supervised-all-minilm-l6-v2-taco-20260326-110508 is a machine learning model from cs4248-nlp. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for sentence-transformers. The card lists the license as mit.
Code-search embedding model trained with the CS4248 two-phase KD pipeline.
Downloads · 30 days
0
Access
Public
Updated Mar 26, 2026
Repo size
90.9 MB
Likes
0
Public
Click a slice to open those files.
.safetensors90.9 MB · 99%
From the Hugging Face model README
Code-search embedding model trained with the CS4248 two-phase KD pipeline.
| Field | Value |
|---|---|
| Role | control-supervised |
| Phase | Phase 2 |
| Method | control-supervised |
| Dataset | BAAI/TACO |
| Teacher | sentence-transformers/all-mpnet-base-v2 |
| Student base | sentence-transformers/all-MiniLM-L6-v2 |
| Phase 1 epochs | 20 |
| Phase 1 patience | 3 |
| Phase 2 epochs | 10 |
| Phase 2 patience | 3 |
| Batch size | 64 |
| Eval batch size | 64 |
| Learning rate | 2e-05 |
| Seed | 42 |
| Run timestamp | 20260326-110508 |
from transformers import AutoModel, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("cs4248-nlp/control-supervised-all-minilm-l6-v2-taco-20260326-110508")
model = AutoModel.from_pretrained("cs4248-nlp/control-supervised-all-minilm-l6-v2-taco-20260326-110508")
Mean-pool the last hidden state to get a fixed-size embedding:
import torch
def mean_pool(model_output, attention_mask):
token_embeddings = model_output.last_hidden_state
mask = attention_mask.unsqueeze(-1).expand(token_embeddings.size()).float()
return (token_embeddings * mask).sum(1) / mask.sum(1).clamp(min=1e-9)
inputs = tokenizer("your query here", return_tensors="pt", truncation=True, max_length=160)
with torch.no_grad():
outputs = model(**inputs)
embedding = mean_pool(outputs, inputs['attention_mask'])