NightOwl-CodeEmbedding
is a 768-dimensional dense embedding model for code
search, code-to-code retrieval, code editing retrieval, and technical QA.
It is based on
Shuu12121/NightOwl
and fine-tuned with hard negatives from code search, code editing, and CoIR
retrieval datasets. The model uses CLS pooling and cosine similarity.
No query or document prefix is required.
Usage
from sentence_transformers import SentenceTransformer
model = SentenceTransformer("Shuu12121/NightOwl-CodeEmbedding")
queries = ["Python function that sorts a list in descending order"]
documents = [
"def sort_desc(values): return sorted(values, reverse=True)",
"def average(values): return sum(values) / len(values)",
]
query_embeddings = model.encode(queries, normalize_embeddings=True)
document_embeddings = model.encode(documents, normalize_embeddings=True)
scores = query_embeddings @ document_embeddings.T
print(scores)
Model Details
Property
Value
Base model
Shuu12121/NightOwl
Architecture
ModernBERT
Parameters
~151M
Embedding dimension
768
Pooling
CLS
Maximum sequence length
1,024 tokens
Similarity
Cosine
Query/document prefixes
None
MTEB Results
Evaluated locally with MTEB
2.5.1
on MTEB(Code, v1). Scores are NDCG@10.
Multi-subset task scores are macro averages.
Task
Split
NDCG@10
AppsRetrieval
test
0.37515
COIRCodeSearchNetRetrieval
test
0.83899
CodeEditSearchRetrieval
train
0.73980
CodeFeedbackMT
test
0.77000
CodeFeedbackST
test
0.87046
CodeSearchNetCCRetrieval
test
0.93954
CodeSearchNetRetrieval
test
0.89276
CodeTransOceanContest
test
0.68741
CodeTransOceanDL
test
0.34508
CosQA
test
0.42805
StackOverflowQA
test
0.85416
SyntheticText2SQL
test
0.66188
Macro average
0.70027
Several benchmark families were also represented in the hard-negative
fine-tuning data. Treat these scores as an in-domain evaluation rather than a
strict zero-shot result.
Training
The model was fine-tuned without task prefixes using bidirectional contrastive
learning and hard negatives from:
NightOwl-CodeEmbedding huggingface.co is an AI model on huggingface.co that provides NightOwl-CodeEmbedding's model effect (), which can be used instantly with this Shuu12121 NightOwl-CodeEmbedding model. huggingface.co supports a free trial of the NightOwl-CodeEmbedding model, and also provides paid use of the NightOwl-CodeEmbedding. Support call NightOwl-CodeEmbedding model through api, including Node.js, Python, http.
NightOwl-CodeEmbedding huggingface.co is an online trial and call api platform, which integrates NightOwl-CodeEmbedding's modeling effects, including api services, and provides a free online trial of NightOwl-CodeEmbedding, you can try NightOwl-CodeEmbedding online for free by clicking the link below.
Shuu12121 NightOwl-CodeEmbedding online free url in huggingface.co:
NightOwl-CodeEmbedding is an open source model from GitHub that offers a free installation service, and any user can find NightOwl-CodeEmbedding on GitHub to install. At the same time, huggingface.co provides the effect of NightOwl-CodeEmbedding install, users can directly use NightOwl-CodeEmbedding installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
NightOwl-CodeEmbedding install url in huggingface.co: