CoolFace
Modelpublic

lightonai/LateOn-Code

sourceHugging Faceapache-2.0updated 1mo agoView on Hugging Face
35likes2kdownloads
Model Card

<img src="https://cdn-uploads.huggingface.co/production/uploads/609bbe2f4932693ca2009d6a/BWfClY8hoQISQf9rVa_.png" width="700" height="auto">

LateOn-Code

The LateOn-Code collection is composed of PyLate models optimized for code retrieval. These late interaction models are first pre-trained following the methodology of CoRNStack. These pre-trained models are then further fine-tuned on train sets of CoIR using the nv-retriever methodology to mine hard negatives while preventing false negatives.

We started from the two best ColBERT models on the BEIR benchmark for their respective sizes. The first one, LateOn-Code is based on in-house LateOn model, a new version of GTE-ModernColBERT-v1 built on ModernBERT-base (also developed at LightOn). This version underwent significantly deeper training, crossing the 57 mark on BEIR, almost a 2.5-point improvement and is thus SOTA by a large margin. We'll release this base model along with training data and boilerplates in the near future, so stay tuned\! The second, LateOn-Code-edge is a smaller model based on the edge-colbert model family from mixedbread, using the smallest variant (Ettin-17M) for maximum efficiency. For more details on the training setup, please refer to our blogpost.

The original CoRNStack data in a format compatible with PyLate can be found here while the fine-tuning data can be found here. Training boilerplates can be found here in the PyLate repository

MTEB (Code, v1) benchmark results

<img src="https://cdn-uploads.huggingface.co/production/uploads/609bbe2f4932693ca2009d6a/Dw9JADjB5tdiSsv4wiDbe.png" width="1000" height="auto">

Pre-trained models achieve very competitive results as the 17M model outperforms the very strong granite-embedding-small-english-r2 by an average of 1.7. This is truly impressive, as the granite model is almost three times bigger (17M vs 48M), but is also a beast on its own in the <100M parameters range. It also outperforms the larger granite variant (149M). The larger version nicely scales by improving over the performance of its little sibling by 6.5 on average.

Although the pre-training results are already very impressive given that they are mostly out-of-domain, running a proper fine-tuning using the training data of CoIR significantly boost the performance of the models. Notably, the 17M model increases from 57.50 to 66.64 (+9.14), getting pretty close to EmbeddingGemma-300M while being 17 times smaller. The larger one increases from 63.77 to 74.12 (+10.35), strongly outperforming EmbeddingGemma-300M and getting closer to strong LLM models such as Qwen3-Embedding-0.6B and C2LLM-0.5B while being much smaller.

ModelParamsType**Avg**AppsCOIR CSNetCodeEditCodeFB MTCodeFB STCSNet CCCSNetCodeTrans ContestCodeTrans DLCosQAStackOF QASynth T2SQL
Baseline
BM25-Lexical44.414.7640.8649.8559.1968.1553.9760.0147.7834.4218.7570.2624.94
Small (≤50M)
granite-embedding-small-english-r247MSingle vector55.8413.5460.4657.1652.1976.8548.4278.2877.6333.6335.5890.0446.33
LateOn-Code-edge-pretrain17MMulti vector57.5010.8173.7862.0751.9276.6563.2288.0371.3133.1630.5374.6353.83
LateOn-Code-edge17MMulti vector66.6426.2281.6062.2174.2587.1279.2687.8575.3637.0840.5485.6362.57
Δ (fine-tune - pretrain)+9.14+15.41+7.82+0.14+22.33+10.47+16.04-0.18+4.05+3.92+10.01+11.00+8.74
Medium (100M–300M)
granite-embedding-english-r2149MSingle vector57.2213.9664.6559.3552.5477.1847.6780.7977.0735.0337.0191.8049.55
CodeRankEmbed137MSingle vector60.4723.4583.2059.9842.6178.1068.8989.5066.4334.4935.1780.5363.27
GTE-ModernBERT149MSingle vector71.6657.7283.1055.8386.1586.0093.6188.7672.3537.2743.3691.1464.61
embeddinggemma-300m300MSingle vector68.76<u>84.39</u>75.5462.1051.4280.2673.7190.1585.5133.5243.6086.4758.42
LateOn-Code-pretrain149MMulti vector63.7723.0980.2768.7450.2182.6671.47<u>91.05</u>82.2034.4634.1585.6161.34
LateOn-Code149MMulti vector74.1254.7686.5764.9982.22<u>90.40</u>89.3290.40<u>87.44</u><u>41.00</u><u>45.23</u><u>93.43</u>63.67
Δ (fine-tune - pretrain)+10.35+31.67+6.30-3.75+32.01+7.74+17.85-0.65+5.24+6.54+11.08+7.82+2.33
Large (≥500M)
C2LLM-0.5B500MSingle vector<u>75.46</u>61.02<u>86.71</u><u>71.39</u><u>92.29</u>88.63<u>96.29</u>89.2084.2733.9938.3089.4074.08
Qwen3-Embedding-0.6B600MSingle vector75.4275.3484.6964.4290.8286.3991.7291.0186.0531.3636.4889.99<u>76.74</u>

Best result across all sizes is <u>underlined</u>. Best within each size category is bolded.

Colgrep

The LateOn-Code family model can easily be used within ColGrep, an easy-to-use search tool that give their powerful search capabilities to coding agent. It has been designed to extend grep capabilities to get the best of both world and is very effective to enhance the quality of the answer while diminishing answer time and tokens consumption. Given the performance of the very light-weight 17M model, it can easily run quickly on any computer.

Install ColGrep

bash
# macOS / Linux
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/lightonai/next-plaid/releases/latest/download/colgrep-installer.sh | sh

# Windows (PowerShell)
powershell -c "irm https://github.com/lightonai/next-plaid/releases/latest/download/colgrep-installer.ps1 | iex"

Search

bash
# Semantic search — find code by meaning
colgrep "function that retries HTTP requests"

# Regex search
colgrep -e "async fn\s+\w+"

# Hybrid — regex narrows candidates, semantics ranks them
colgrep -e "Result<" "error handling" --include="*.rs"

Install for Claude Code

bash
colgrep --install-claude-code

Choose a Model

bash
# Set the model
colgrep set-model lightonai/LateOn-Code  # default: lightonai/LateOn-Code-edge

For more information about ColGrep, please refer to the official documentation

Model

This is a multi-vector (ColBERT-style late interaction) embedding model finetuned from lightonai/LateOn-Code-pretrain on the apps, synthetictext2sql, cosqa, codefeedbackst, codefeedbackmt, stackoverflowqa, codetranscontest, codetransdl, CodeSearchNet_go, CodeSearchNet_java, CodeSearchNet_javascript, CodeSearchNet_php, CodeSearchNet_python, CodeSearchNet_ruby, CodeSearchNet_ccr_go, CodeSearchNet_ccr_java, CodeSearchNet_ccr_javascript, CodeSearchNet_ccr_php, CodeSearchNet_ccr_python and CodeSearchNet_ccr_ruby datasets. It maps sentences & paragraphs to sequences of 128-dimensional dense vectors and can be used for semantic textual similarity using the MaxSim operator.

Model Details

Model Description

Model Sources

Full Model Architecture

ColBERT(
  (0): Transformer({'max_seq_length': 2047, 'do_lower_case': False, 'architecture': 'ModernBertModel'})
  (1): Dense({'in_features': 768, 'out_features': 128, 'bias': False, 'activation_function': 'torch.nn.modules.linear.Identity', 'use_residual': False})
)

Usage

Sentence Transformers

This model can be used with Sentence Transformers as a multi-vector (ColBERT-style late interaction) retriever via the MultiVectorEncoder:

bash
pip install "sentence-transformers>=6.0.0"
python
from sentence_transformers import MultiVectorEncoder

model = MultiVectorEncoder("lightonai/LateOn-Code")

query = "Which planet is known as the Red Planet?"
documents = [
    "Venus is often called Earth's twin because of its similar size and proximity.",
    "Mars, known for its reddish appearance, is often referred to as the Red Planet.",
    "Jupiter, the largest planet in our solar system, has a prominent red spot.",
    "Saturn, famous for its rings, is sometimes mistaken for the Red Planet.",
]

query_embeddings = model.encode_query(query)
document_embeddings = model.encode_document(documents)
print(query_embeddings.shape, document_embeddings[0].shape)
# (12, 128) (18, 128)

# MaxSim late-interaction scoring (higher is more relevant)
scores = model.similarity(query_embeddings, document_embeddings)
print(scores)
# tensor([[4.7803, 8.2878, 6.5700, 7.0952]])

PyLate

First install the PyLate library:

bash
pip install -U pylate

Retrieval

Use this model with PyLate to index and retrieve documents. The index uses FastPLAID for efficient similarity search.

Indexing documents

Load the ColBERT model and initialize the PLAID index, then encode and index your documents:

python
from pylate import indexes, models, retrieve

# Step 1: Load the ColBERT model
model = models.ColBERT(
    model_name_or_path="pylate_model_id",
)

# Step 2: Initialize the PLAID index
index = indexes.PLAID(
    index_folder="pylate-index",
    index_name="index",
    override=True,  # This overwrites the existing index if any
)

# Step 3: Encode the documents
documents_ids = ["1", "2", "3"]
documents = ["document 1 text", "document 2 text", "document 3 text"]

documents_embeddings = model.encode(
    documents,
    batch_size=32,
    is_query=False,  # Ensure that it is set to False to indicate that these are documents, not queries
    show_progress_bar=True,
)

# Step 4: Add document embeddings to the index by providing embeddings and corresponding ids
index.add_documents(
    documents_ids=documents_ids,
    documents_embeddings=documents_embeddings,
)

Note that you do not have to recreate the index and encode the documents every time. Once you have created an index and added the documents, you can re-use the index later by loading it:

python
# To load an index, simply instantiate it with the correct folder/name and without overriding it
index = indexes.PLAID(
    index_folder="pylate-index",
    index_name="index",
)
Retrieving top-k documents for queries

Once the documents are indexed, you can retrieve the top-k most relevant documents for a given set of queries. To do so, initialize the ColBERT retriever with the index you want to search in, encode the queries and then retrieve the top-k documents to get the top matches ids and relevance scores:

python
# Step 1: Initialize the ColBERT retriever
retriever = retrieve.ColBERT(index=index)

# Step 2: Encode the queries
queries_embeddings = model.encode(
    ["query for document 3", "query for document 1"],
    batch_size=32,
    is_query=True,  #  # Ensure that it is set to False to indicate that these are queries
    show_progress_bar=True,
)

# Step 3: Retrieve top-k documents
scores = retriever.retrieve(
    queries_embeddings=queries_embeddings,
    k=10,  # Retrieve the top 10 matches for each query
)

Reranking

If you only want to use the ColBERT model to perform reranking on top of your first-stage retrieval pipeline without building an index, you can simply use rank function and pass the queries and documents to rerank:

python
from pylate import rank, models

queries = [
    "query A",
    "query B",
]

documents = [
    ["document A", "document B"],
    ["document 1", "document C", "document B"],
]

documents_ids = [
    [1, 2],
    [1, 3, 2],
]

model = models.ColBERT(
    model_name_or_path="pylate_model_id",
)

queries_embeddings = model.encode(
    queries,
    is_query=True,
)

documents_embeddings = model.encode(
    documents,
    is_query=False,
)

reranked_documents = rank.rerank(
    documents_ids=documents_ids,
    queries_embeddings=queries_embeddings,
    documents_embeddings=documents_embeddings,
)

<!--

Direct Usage (Transformers)

<details><summary>Click to see the direct usage in Transformers</summary>

</details> -->

<!--

Downstream Usage (Sentence Transformers)

You can finetune this model on your own dataset.

<details><summary>Click to expand</summary>

</details> -->

<!--

Out-of-Scope Use

List how the model may foreseeably be misused and address what users ought not to do with the model. -->

Evaluation

Metrics

Py Late Information Retrieval
  • Dataset: ['CodeSearchNetPython', 'CodeSearchNetJavascript', 'CodeSearchNetGo', 'CodeSearchNetRuby', 'CodeSearchNetJava', 'CodeSearchNetPhp']
  • Evaluated with <code>pylate.evaluation.pylateinformationretrieval_evaluator.PyLateInformationRetrievalEvaluator</code>
MetricCodeSearchNetPythonCodeSearchNetJavascriptCodeSearchNetGoCodeSearchNetRubyCodeSearchNetJavaCodeSearchNetPhp
MaxSim_accuracy@10.8840.7370.9130.7760.8140.811
MaxSim_accuracy@30.9650.8390.980.8950.9380.922
MaxSim_accuracy@50.9760.8660.9860.9230.9480.947
MaxSim_accuracy@100.9840.8880.9890.9360.9610.96
MaxSim_precision@10.8840.7370.9130.7760.8140.811
MaxSim_precision@30.32170.27970.32670.29830.31270.3073
MaxSim_precision@50.19520.17320.19720.18460.18960.1894
MaxSim_precision@100.09840.08880.09890.09360.09610.096
MaxSim_recall@10.8840.7370.9130.7760.8140.811
MaxSim_recall@30.9650.8390.980.8950.9380.922
MaxSim_recall@50.9760.8660.9860.9230.9480.947
MaxSim_recall@100.9840.8880.9890.9360.9610.96
MaxSim_ndcg@100.93930.81690.95770.86180.89780.8918
MaxSim_mrr@100.92440.79370.9470.83720.87650.8691
MaxSim_map@1000.9250.79650.94740.83850.87730.8696
Code Search Network
  • Dataset: CodeSearchNet_mean
  • Evaluated with <code>pylate.evaluation.codesearchnetwork_evaluator.CodeSearchNetworkEvaluator</code>
MetricValue
MaxSim_accuracy@10.8225
MaxSim_accuracy@30.9232
MaxSim_accuracy@50.941
MaxSim_accuracy@100.953
MaxSim_precision@10.8225
MaxSim_precision@30.3077
MaxSim_precision@50.1882
MaxSim_precision@100.0953
MaxSim_recall@10.8225
MaxSim_recall@30.9232
MaxSim_recall@50.941
MaxSim_recall@100.953
MaxSim_ndcg@100.8942
MaxSim_mrr@100.8746
MaxSim_map@1000.8757

<!--

Bias, Risks and Limitations

What are the known or foreseeable issues stemming from this model? You could also flag here known failure cases or weaknesses of the model. -->

<!--

Recommendations

What are recommendations with respect to the foreseeable issues? For example, filtering explicit content. -->

Training Details

Training Datasets

apps
  • Dataset: apps at 68d15dc
  • Size: 4,985 training samples
  • Approximate statistics based on the first 1000 samples: | | query | positive | negative0 | negative1 | negative2 | negative3 | negative4 | negative5 | negative6 | negative7 | negative8 | negative9 | negative10 | negative11 | negative12 | negative13 | negative14 | negative15 | negative16 | negative17 | negative18 | negative19 | negative20 | negative21 | negative22 | negative23 | negative24 | negative25 | negative26 | negative27 | negative28 | negative29 | negative30 | negative31 | negative32 | negative33 | negative34 | negative35 | negative36 | negative37 | negative38 | negative39 | negative40 | negative41 | negative42 | negative43 | negative44 | negative45 | negative46 | negative47 | negative48 | negative49 | |:--------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------| | type | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | | details | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
  • Samples: | query | positive | negative0 | |:------|:---------|:-----------| | <code>{'query': 'Polycarp has $n$ different binary words. A word called binary if it contains only characters \'0\' and \'1\'. For example, these words are binary: "0001", "11", "0" and "0011100".\n\nPolycarp wants to offer his set of $n$ binary words to play a game "words". In this game, players name words and each next word (starting from the second) must start with the last character of the previous word. The first word can be any. For example, these sequence of words can be named during the game: "0101", "1", "10", "00", "00001".\n\nWord reversal is the operation of reversing the order of the characters. For example, the word "0111" after the reversal becomes "1110", the word "11010" after the reversal becomes "01011".\n\nProbably, Polycarp has such a set of words that there is no way to put them in the order correspondent to the game rules. In this situation, he wants to reverse some words from his set so that: the final set of $n$ words still contains different words (i.e. all words are unique); there is a way to put all words of the final set of words in the order so that the final sequence of $n$ words is consistent with the game rules. \n\nPolycarp wants to reverse minimal number of words. Please, help him.\n\n\n-----Input-----\n\nThe first line of the input contains one integer $t$ ($1 \\le t \\le 10^4$) — the number of test cases in the input. Then $t$ test cases follow.\n\nThe first line of a test case contains one integer $n$ ($1 \\le n \\le 2\\cdot10^5$) — the number of words in the Polycarp\'s set. Next $n$ lines contain these words. All of $n$ words aren\'t empty and contains only characters \'0\' and \'1\'. The sum of word lengths doesn\'t exceed $4\\cdot10^6$. All words are different.\n\nGuaranteed, that the sum of $n$ for all test cases in the input doesn\'t exceed $2\\cdot10^5$. Also, guaranteed that the sum of word lengths for all test cases in the input doesn\'t exceed $4\\cdot10^6$.\n\n\n-----Output-----\n\nPrint answer for all of $t$ test cases in the order they appear.\n\nIf there is no answer for the test case, print -1. Otherwise, the first line of the output should contain $k$ ($0 \\le k \\le n$) — the minimal number of words in the set which should be reversed. The second line of the output should contain $k$ distinct integers — the indexes of the words in the set which should be reversed. Words are numerated from $1$ to $n$ in the order they appear. If $k=0$ you can skip this line (or you can print an empty line). If there are many answers you can print any of them.\n\n\n-----Example-----\nInput\n4\n4\n0001\n1000\n0011\n0111\n3\n010\n101\n0\n2\n00000\n00001\n4\n01\n001\n0001\n00001\n\nOutput\n1\n3 \n-1\n0\n\n2\n1 2', 'queryid': 0}</code> | <code>{'document': "for in range(int(input())):\n n = int(input())\n mass = []\n zo = 0\n oz = 0\n zz = 0\n oo = 0\n ozs = []\n zos = []\n ozss = set()\n zoss = set()\n for j in range(n):\n k = input()\n mass.append(k)\n if k[0] == '0' and k[-1] == '1':\n zoss.add(k)\n zos.append(j + 1)\n zo += 1\n elif k[0] == '1' and k[-1] == '0':\n ozss.add(k)\n ozs.append(j + 1)\n oz += 1\n elif k[0] == '0' and k[-1] == '0':\n zz += 1\n else:\n oo += 1\n if zz and oo and not oz and not zo:\n print(-1)\n continue\n else:\n if zo &gt; oz:\n print((zo - oz) // 2)\n ans = []\n need = (zo - oz) // 2\n i = 0\n while need:\n zzz = mass[zos[i] - 1][len(mass[zos[i] - 1]) - 1:: -1]\n if zzz not in ozss:\n ans.append(zos[i])\n need -= 1\n i += 1\n print(*ans)\n else:\n print((oz - zo) // 2)\n ans = []\n need = (oz - zo) // 2\n i = 0\n while need:\n zzz = mass[ozs[i] - 1][len(mass[ozs[i] - 1]) - 1:: -1]\n if zzz not in zoss:\n ans.append(ozs[i])\n need -= 1\n i += 1\n print(*ans)\n", 'documentid': 0}</code> | <code>{'document': "t=int(input())\nfor in range(t):\n n=int(input())\n l=list(map(int,input().split()))\n if sum(l)!=n or max(l)==n:\n print('-1')\n else:\n d=dict()\n ans=[-1]*n\n for i in range(0,n):\n d[i]=1\n for i in range(n):\n if l[i]!=0:\n count=l[i]\n for k,v in list(d.items()):\n if count&gt;0 and v==1 and i!=k:\n d[k]=0\n ans[k]=i+1\n count-=1\n ind=-1\n for i in range(0,len(ans)):\n if ans[i]==-1:\n ind=i\n if ind==-1:\n print(*ans)\n else:\n for i in range(len(ans)):\n if ans[i]!=ind+1:\n \n \n ans[ind]=ans[i]\n ans[i]=ind+1\n break\n print(*ans)\n \n \n \n \n\n \n \n \n\n \n", 'documentid': 866}</code> |
  • Loss: <code>pylate.losses.contrastive.Contrastive</code>
synthetictext2sql
  • Dataset: synthetictext2sql at 68d15dc
  • Size: 99,996 training samples
  • Approximate statistics based on the first 1000 samples: | | query | positive | negative0 | negative1 | negative2 | negative3 | negative4 | negative5 | negative6 | negative7 | negative8 | negative9 | negative10 | negative11 | negative12 | negative13 | negative14 | negative15 | negative16 | negative17 | negative18 | negative19 | negative20 | negative21 | negative22 | negative23 | negative24 | negative25 | negative26 | negative27 | negative28 | negative29 | negative30 | negative31 | negative32 | negative33 | negative34 | negative35 | negative36 | negative37 | negative38 | negative39 | negative40 | negative41 | negative42 | negative43 | negative44 | negative45 | negative46 | negative47 | negative48 | negative49 | |:--------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------| | type | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | | details | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
  • Samples: | query | positive | negative0 | |:------|:---------|:-----------| | <code>{'query': 'What is the total volume of timber sold by each salesperson, sorted by salesperson?', 'queryid': 0}</code> | <code>{'document': 'SELECT salespersonid, name, SUM(volume) as totalvolume FROM timbersales JOIN salesperson ON timbersales.salespersonid = salesperson.salespersonid GROUP BY salespersonid, name ORDER BY totalvolume DESC;', 'documentid': 0}</code> | <code>{'document': 'SELECT salespersonid, SUM(volume) as totalvolume FROM timbersales JOIN salesperson ON timbersales.salespersonid = salesperson.salespersonid GROUP BY salespersonid ORDER BY totalvolume DESC LIMIT 1;', 'documentid': 53110}</code> |
  • Loss: <code>pylate.losses.contrastive.Contrastive</code>
cosqa
  • Dataset: cosqa at 68d15dc
  • Size: 9,018 training samples
  • Approximate statistics based on the first 1000 samples: | | query | positive | negative0 | negative1 | negative2 | negative3 | negative4 | negative5 | negative6 | negative7 | negative8 | negative9 | negative10 | negative11 | negative12 | negative13 | negative14 | negative15 | negative16 | negative17 | negative18 | negative19 | negative20 | negative21 | negative22 | negative23 | negative24 | negative25 | negative26 | negative27 | negative28 | negative29 | negative30 | negative31 | negative32 | negative33 | negative34 | negative35 | negative36 | negative37 | negative38 | negative39 | negative40 | negative41 | negative42 | negative43 | negative44 | negative45 | negative46 | negative47 | negative48 | negative49 | |:--------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------| | type | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | | details | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
  • Samples: | query | positive | negative0 | |:------|:---------|:-----------| | <code>{'query': '1d array in char datatype in python', 'queryid': 9}</code> | <code>{'document': 'def converttoarray(arraylike, dtype):\n """\n Convert Matrix attributes which are array-like or buffer to array.\n """\n if isinstance(arraylike, bytes):\n return np.frombuffer(arraylike, dtype=dtype)\n return np.asarray(arraylike, dtype=dtype)', 'documentid': 9}</code> | <code>{'document': 'def astype(array, y):\n """A functional form of the astype method.\n\n Args:\n array: The array or number to cast.\n y: An array or number, as the input, whose type should be that of array.\n\n Returns:\n An array or number with the same dtype as y.\n """\n if isinstance(y, autograd.core.Node):\n return array.astype(numpy.array(y.value).dtype)\n return array.astype(numpy.array(y).dtype)', 'document_id': 14052}</code> |
  • Loss: <code>pylate.losses.contrastive.Contrastive</code>
codefeedbackst
  • Dataset: codefeedbackst at 68d15dc
  • Size: 125,124 training samples
  • Approximate statistics based on the first 1000 samples: | | query | positive | negative0 | negative1 | negative2 | negative3 | negative4 | negative5 | negative6 | negative7 | negative8 | negative9 | negative10 | negative11 | negative12 | negative13 | negative14 | negative15 | negative16 | negative17 | negative18 | negative19 | negative20 | negative21 | negative22 | negative23 | negative24 | negative25 | negative26 | negative27 | negative28 | negative29 | negative30 | negative31 | negative32 | negative33 | negative34 | negative35 | negative36 | negative37 | negative38 | negative39 | negative40 | negative41 | negative42 | negative43 | negative44 | negative45 | negative46 | negative47 | negative48 | negative49 | |:--------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------| | type | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | | details | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
  • Samples: | query | positive | negative0 | |:------|:---------|:-----------| | <code>{'query': 'You are tasked with implementing a Python class that extends a base class and overrides its methods. Your task is to create a class called `TestsslFinding` that inherits from the `VSFinding` class. The `VSFinding` class is not explicitly defined in the given code snippet, but it is assumed to be a base class with certain methods that need to be overridden in the `TestsslFinding` class. Your implementation should include the necessary method overrides and any additional methods or attributes required to fulfill the specified functionality.\n\nYour `TestsslFinding` class should provide the following functionality:\n1. Override the `processfinding method: This method should take in a finding as input and process it according to the specific requirements of the TestsslFinding class. The exact implementation of this method is not provided, but it should be tailored to the needs of the TestsslFinding class.\n2. Any additional methods or attributes required to support the functionality of the TestsslFinding class.\n\nYour implementation should adhere to the principles of object-oriented programming and demonstrate a clear understanding of class inheritance and method overriding in Python.', 'query_id': 0}</code> | <code>{'document': '`python\nclass TestsslFinding(VSFinding):\n def process_finding(self, finding):\n # Custom implementation of processing finding for TestsslFinding\n pass\n\n # Additional methods or attributes can be added as per specific requirements\n`\nIn the solution, the TestsslFinding class is defined to inherit from the VSFinding class. The processfinding` method is overridden to provide a custom implementation tailored to the needs of the `TestsslFinding` class. Additional methods or attributes can be included as per the specific requirements of the class. This solution demonstrates the implementation of class inheritance and method overriding in Python.', 'documentid': 0}</code> | <code>{'document': '``python\nfrom googlecloudsdk.calliope import base\nfrom googlecloudsdk.api_lib.sql import ssl_certs_api\n\n\nclass SslCerts(base.Group):\n """Provide commands for managing SSL certificates of Cloud SQL instances."""\n\n def create_certificate(self, instance_id, common_name):\n """Create a new SSL certificate for the specified Cloud SQL instance."""\n ssl_certs_api.SslCertsApi().insert(\n project=self.project,\n instance=instance_id,\n body={\'commonName\': common_name}\n )\n\n def delete_certificate(self, instance_id, sha1_fingerprint):\n """Delete the SSL certificate with the specified SHA-1 fingerprint from the Cloud SQL instance."""\n ssl_certs_api.SslCertsApi().delete(\n project=self.project,\n instance=instance_id,\n sha1Fingerprint=sha1_fingerprint\n )\n\n def list_certificates(self, instance_id):\n """List all SSL certificates associated with the specified Cloud SQL instance."""\n return ssl_certs_api.SslCertsApi().list(\n project=self.project,\n instance=instance_id\n )\n\n def get_certificate(self, instance_id, sha1_fingerprint):\n """Retrieve detailed information about the SSL certificate with the specified SHA-1 fingerprint."""\n return ssl_certs_api.SslCertsApi().get(\n project=self.project,\n instance=instance_id,\n sha1Fingerprint=sha1_fingerprint\n )\n`\nIn the solution, the SslCerts class inherits from the base.Group class and provides methods for creating, deleting, listing, and retrieving information about SSL certificates associated with Cloud SQL instances. Each method interacts with the sslcertsapi` to perform the respective operations, ensuring seamless management of SSL certificates for Cloud SQL instances.', 'document_id': 108284}</code> |
  • Loss: <code>pylate.losses.contrastive.Contrastive</code>
codefeedbackmt
  • Dataset: codefeedbackmt at 68d15dc
  • Size: 52,941 training samples
  • Approximate statistics based on the first 1000 samples: | | query | positive | negative0 | negative1 | negative2 | negative3 | negative4 | negative5 | negative6 | negative7 | negative8 | negative9 | negative10 | negative11 | negative12 | negative13 | negative14 | negative15 | negative16 | negative17 | negative18 | negative19 | negative20 | negative21 | negative22 | negative23 | negative24 | negative25 | negative26 | negative27 | negative28 | negative29 | negative30 | negative31 | negative32 | negative33 | negative34 | negative35 | negative36 | negative37 | negative38 | negative39 | negative40 | negative41 | negative42 | negative43 | negative44 | negative45 | negative46 | negative47 | negative48 | negative49 | |:--------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------| | type | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | | details | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
  • Samples: | query | positive | negative0 | |:------|:---------|:-----------| | <code>{'query': "'user': Embark on a comprehensive journey through the intricate realm of quantum computing, with a specific focus on its paramount significance in the realm of high-performance computing. Could you meticulously construct a narrative that systematically outlines the genesis, progression, and practical implementation of computational models deeply entrenched in the principles of quantum computing, capitalizing on their inherent computational supremacy? This narrative should aim for the pinnacle of computational efficiency while addressing potential limitations inherent to quantum computing, concentrating on systematic approaches for identifying and rectifying computational irregularities. Moreover, it should incorporate a refined, structured analytical framework for surmounting hurdles, necessitating a wide range of analytical prowess and adaptable problem-solving skills. It should also highlight potential impediments and their solutions, intertwined with a profound comprehension of quantum superposition and its influence on computational efficiency. Additionally, it should delve into the intricacies of quantum bit manipulation and data accuracy, along with the most effective techniques for continuous surveillance and upkeep in the quantum computing industry. In conclusion, it should provide a detailed analysis of potential computational threats and the most effective strategies to ensure the ongoing advancement and widespread acceptance of quantum computing principles in the era of high-performance computing. Could you also elucidate the role of quantum computing within the architecture of state-of-the-art computational systems, and how it can be harnessed to construct a sturdy and efficient computational infrastructure in the face of intricate computational challenges?, 'assistant': Quantum computing is a relatively new and rapidly advancing field that holds immense promise for revolutionizing the realm of high-performance computing. In this narrative, we will delve into the genesis, progression, and practical implementation of computational models grounded in the principles of quantum computing. We will explore their inherent computational supremacy, while also addressing potential limitations and providing systematic approaches for identifying and rectifying computational irregularities.\n\nThe journey through the intricate realm of quantum computing begins with understanding its genesis. Quantum computing originated from the fusion of quantum mechanics and computer science. It leverages the principles of quantum mechanics, such as superposition and entanglement, to perform computations in ways that surpass classical computers' capabilities.\n\nAs quantum computing has progressed, researchers and scientists have made significant strides in exploring its practical implementation. Quantum computers operate using quantum bits, also known as qubits, which are the fundamental building blocks of quantum information. Unlike classical bits, which can only be in a state of 0 or 1, qubits can exist in a superposition of both states simultaneously. This quantum superposition allows for parallel processing, exponentially increasing the computational power of quantum computers.\n\nHowever, along with the immense potential, quantum computing faces several challenges. One of the primary limitations is decoherence, where the delicate quantum states of qubits interact with the environment, causing them to lose their quantum properties. This leads to errors and computational irregularities. To overcome this, systematic approaches are employed to identify and rectify these irregularities, such as error correction codes and noise reduction techniques.\n\nTo harness the power of quantum computing effectively, a refined and structured analytical framework is essential. Adaptable problem-solving skills and analytical prowess are needed to address the intricacies of quantum bit manipulation and ensure data accuracy. Continuous surveillance and upkeep are crucial in the quantum computing industry to maintain the integrity of quantum systems.\n\nDespite its potential, quantum computing still faces potential impediments. Computational threats, such as quantum algorithms capable of breaking modern cryptographic systems, need to be carefully analyzed and addressed. Therefore, effective strategies for safeguarding data and communication channels must be devised to ensure the ongoing advancement and widespread acceptance of quantum computing principles.\n\nFurthermore, quantum computing plays a crucial role within the architecture of state-of-the-art computational systems. It can be harnessed to construct a sturdy and efficient computational infrastructure to tackle intricate computational challenges. By leveraging the computational supremacy of quantum computing, complex problems in fields such as optimization, material science, and machine learning can be solved more efficiently.\n\nIn summary, the journey through the realm of quantum computing highlights its genesis, progression, and practical implementation. We have explored the concept of computational supremacy, potential limitations, and systematic approaches for identifying and rectifying computational irregularities. It has also emphasized the importance of a refined analytical framework, comprehension of quantum superposition, and effective techniques for continuous surveillance and upkeep. Finally, we have analyzed potential computational threats and the strategies needed to ensure the ongoing advancement and widespread acceptance of quantum computing principles in the era of high-performance computing., 'user': No code has been generated yet. Could you please generate a code snippet related to quantum computing?", 'queryid': 0}</code> | <code>{'document': "Regrettably, there are no standard Python libraries available for quantum computing that could generate a simple block of code relevant to this conversation. Quantum computing requires specialized software and hardware that typically are not available on conventional computer systems and neither on the interpreter I use currently. However, for educational purposes, here's a general template of a theoretical quantum program using an open-source quantum computing framework Qiskit. Note that this Python code will not run in the current environment.\n\n``python\nfrom qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister\nfrom qiskit import execute, Aer\n\n# Create a Quantum Register with 2 qubits.\nq = QuantumRegister(2)\n\n# Create a Classical Register with 2 bits.\nc = ClassicalRegister(2)\n\n# Create a Quantum Circuit\nqc = QuantumCircuit(q, c)\n\n# Add a H gate on qubit 0, putting this qubit in superposition.\nqc.h(q[0])\n\n# Add a CX (CNOT) gate on control qubit 0 and target qubit 1, putting the qubits in a Bell state.\nqc.cx(q[0], q[1])\n\n# Add a Measure gate to see the state.\nqc.measure(q, c)\n\nprint(qc)\n``\n\nThis is a basic quantum circuit in Qiskit that sets up two qubits in a Bell state. A Bell state is a quantum state of a system where the amount of information about the overall system does not fully specify the possible results of measurements on the subsystems. This gives rise to the interesting and non-intuitive phenomena in quantum mechanics such as quantum entanglement.\n\nIn this example, we apply a Hadamard (H) gate to put the first qubit in a superposition state (a state of both 0 and 1 simultaneously). We then apply a CNOT gate with the first qubit as control and the second as the target. This creates entanglement between the two qubits. Finally, we measure the two qubits.", 'documentid': 0}</code> | <code>{'document': "The provided code block constructs a quantum circuit with a Hadamard gate (which allows us to establish a superposition state), and a measurement gate. When we measure a qubit in a superposition state, we observe one of the possible states and the qubit will collapse to that measured state.\n\nThe measurement results are then plotted in a histogram. Here, you can observe that we obtain both '0' and '1' states close to an equal number of times. This represents the probabilistic outcomes when measuring a qubit initially put in a superposition state via a Hadamard gate. The '0' state was measured 495 times, and the '1' state was measured 529 times, out of a (default) total of 1024 runs in the Qiskit quantum simulator ('qasmsimulator').\n\nThis showcases the fundamental principle of quantum superposition - where a qubit isn't merely in a '0' or '1' state but can exist in a superposition of these states until measured.", 'document_id': 51749}</code> |
  • Loss: <code>pylate.losses.contrastive.Contrastive</code>
stackoverflowqa
  • Dataset: stackoverflowqa at 68d15dc
  • Size: 13,934 training samples
  • Approximate statistics based on the first 1000 samples: | | query | positive | negative0 | negative1 | negative2 | negative3 | negative4 | negative5 | negative6 | negative7 | negative8 | negative9 | negative10 | negative11 | negative12 | negative13 | negative14 | negative15 | negative16 | negative17 | negative18 | negative19 | negative20 | negative21 | negative22 | negative23 | negative24 | negative25 | negative26 | negative27 | negative28 | negative29 | negative30 | negative31 | negative32 | negative33 | negative34 | negative35 | negative36 | negative37 | negative38 | negative39 | negative40 | negative41 | negative42 | negative43 | negative44 | negative45 | negative46 | negative47 | negative48 | negative49 | |:--------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------| | type | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | | details | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
  • Samples: | query | positive | negative0 | |:------|:---------|:-----------| | <code>{'query': 'sphinxsearch-0.9 in mediawiki-1.32.0 error 2019/01/14 12:04:51 [error] 21549#21549: *3558 FastCGI sent in stderr: "PHP message: PHP Fatal error: Class SphinxMWSearch contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (SearchDatabase::doSearchTextInDB, SearchDatabase::doSearchTitleInDB) in /var/opt/www/extensions/SphinxSearch/SphinxMWSearch.php on line 15" while reading response header from upstream, client: 192.168.122.1, server: wiki.yuyizhi.org, request: "GET /index.php?title=Special:%E6%90%9C%E7%B4%A2&amp;search=sphinx HTTP/1.0", upstream: "fastcgi://unix:/var/run/php-fpm/php5-fpm.sock:", host: "wiki.yuyizhi.org"\n\nFastCGI sent in stderr: "PHP message: PHP Fatal error: Class SphinxMWSearch contains 2 abstract methods and must therefore be declared abstract or implement the remaining methods (SearchDatabase::doSearchTextInDB, SearchDatabase::doSearchTitleInDB) in /var/opt/www/extensions/SphinxSearch/SphinxMWSearch.php on line 15", client: 192.168.122.1, server: wiki.abc.com, request: "GET /api.php?action=opensearch&amp;search=bai&amp;namespace=0 HTTP/1.0", host: "wiki.abc.com"', 'queryid': 0}</code> | <code>{'document': 'The SearchDatabase class that SphinxSearch extends was changed from REL131 to REL132. It now requires you to define doSearchTextInDB and doSearchTitleInDB methods.\nSee REL131 https://doc.wikimedia.org/mediawiki-core/REL131/php/classSearchDatabase.html\nvs REL132 https://doc.wikimedia.org/mediawiki-core/REL132/php/classSearchDatabase.html\nThis is sortof mentioned in the patch notes if you search for Search under deprecation (note this is a Backwards compatibility break instead) https://www.mediawiki.org/wiki/Releasenotes/1.32#Compatibility:\n\nOverriding SearchEngine::{searchText,searchTitle,searchArchiveTitle} in extending classes is deprecated. Extend related doSearch* methods instead.\n\nIf you are like me and not comfortable fixing the extension yourself, you will have to wait for one of the extension contributors to update the extension to work with REL132. Until then you will have to stay on REL131 if you wish to use the extension.\n\nA: Just adding these two empty functions to SphinxMWSearch.php under the definition of SphinxMWSearch class seems to do the trick. It makes it stop complaining and - as far as I can tell - search function is working fine.\nfunction doSearchTextInDB($term) {\n}\nfunction doSearchTitleInDB($term) {\n}\n\nHopefully developers of this extension will come up with a proper fix soon.', 'documentid': 0}</code> | <code>{'document': 'I was running MediaWiki 1.16.0. I upgraded to MediaWiki 1.16.2 and this resolved the issue.', 'document_id': 5766}</code> |
  • Loss: <code>pylate.losses.contrastive.Contrastive</code>
codetranscontest
  • Dataset: codetranscontest at 68d15dc
  • Size: 561 training samples
  • Approximate statistics based on the first 561 samples: | | query | positive | negative0 | negative1 | negative2 | negative3 | negative4 | negative5 | negative6 | negative7 | negative8 | negative9 | negative10 | negative11 | negative12 | negative13 | negative14 | negative15 | negative16 | negative17 | negative18 | negative19 | negative20 | negative21 | negative22 | negative23 | negative24 | negative25 | negative26 | negative27 | negative28 | negative29 | negative30 | negative31 | negative32 | negative33 | negative34 | negative35 | negative36 | negative37 | negative38 | negative39 | negative40 | negative41 | negative42 | negative43 | negative44 | negative45 | negative46 | negative47 | negative48 | negative49 | |:--------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------| | type | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | | details | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
  • Samples: | query | positive | negative0 | |:------|:---------|:-----------| | <code>{'query': 'Julia set from future import division\n\ncX = -0.7\ncY = 0.27015\nmaxIter = 300\n\ndef setup():\n size(640, 480)\n\ndef draw():\n for x in range(width):\n for y in range(height):\n zx = 1.5 * (x - width / 2) / (0.5 * width)\n zy = (y - height / 2) / (0.5 * height)\n i = maxIter\n while zx * zx + zy * zy &lt; 4 and i &gt; 0:\n tmp = zx * zx - zy * zy + cX\n zy = 2.0 * zx * zy + cY\n zx = tmp\n i -= 1\n colorMode(HSB)\n c = color(i / maxIter * 255, 255, 255 if i &gt; 1 else 0)\n set(x, y, c)\n', 'queryid': 0}</code> | <code>{'document': '#include &lt;windows.h&gt;\n#include &lt;string&gt;\n#include &lt;complex&gt;\n\nconst int BMPSIZE = 600, ITERATIONS = 512;\nconst long double FCT = 2.85, hFCT = FCT / 2.0;\n\nclass myBitmap {\npublic:\n myBitmap() : pen( NULL ), brush( NULL ), clr( 0 ), wid( 1 ) {}\n ~myBitmap() {\n DeleteObject( pen ); DeleteObject( brush );\n DeleteDC( hdc ); DeleteObject( bmp );\n }\n bool create( int w, int h ) {\n BITMAPINFO bi;\n ZeroMemory( &amp;bi, sizeof( bi ) );\n bi.bmiHeader.biSize = sizeof( bi.bmiHeader );\n bi.bmiHeader.biBitCount = sizeof( DWORD ) * 8;\n bi.bmiHeader.biCompression = BIRGB;\n bi.bmiHeader.biPlanes = 1;\n bi.bmiHeader.biWidth = w;\n bi.bmiHeader.biHeight = -h;\n HDC dc = GetDC( GetConsoleWindow() );\n bmp = CreateDIBSection( dc, &amp;bi, DIBRGBCOLORS, &amp;pBits, NULL, 0 );\n if( !bmp ) return false;\n hdc = CreateCompatibleDC( dc );\n SelectObject( hdc, bmp );\n ReleaseDC( GetConsoleWindow(), dc );\n width = w; height = h;\n return true;\n }\n void clear( BYTE clr = 0 ) {\n memset( pBits, clr, width height sizeof( DWORD ) );\n }\n void setBrushColor( DWORD bClr ) {\n if( brush ) DeleteObject( brush );\n brush = CreateSolidBrush( bClr );\n SelectObject( hdc, brush );\n }\n void setPenColor( DWORD c ) {\n clr = c; createPen();\n }\n void setPenWidth( int w ) {\n wid = w; createPen();\n }\n void saveBitmap( std::string path ) {\n BITMAPFILEHEADER fileheader;\n BITMAPINFO infoheader;\n BITMAP bitmap;\n DWORD wb;\n GetObject( bmp, sizeof( bitmap ), &amp;bitmap );\n DWORD dwpBits = new DWORD[bitmap.bmWidth bitmap.bmHeight];\n ZeroMemory( dwpBits, bitmap.bmWidth bitmap.bmHeight sizeof( DWORD ) );\n ZeroMemory( &amp;infoheader, sizeof( BITMAPINFO ) );\n ZeroMemory( &amp;fileheader, sizeof( BITMAPFILEHEADER ) );\n infoheader.bmiHeader.biBitCount = sizeof( DWORD ) 8;\n infoheader.bmiHeader.biCompression = BI_RGB;\n infoheader.bmiHeader.biPlanes = 1;\n infoheader.bmiHeader.biSize = sizeof( infoheader.bmiHeader );\n infoheader.bmiHeader.biHeight = bitmap.bmHeight;\n infoheader.bmiHeader.biWidth = bitmap.bmWidth;\n infoheader.bmiHeader.biSizeImage = bitmap.bmWidth bitmap.bmHeight sizeof( DWORD );\n fileheader.bfType = 0x4D42;\n fileheader.bfOffBits = sizeof( infoheader.bmiHeader ) + sizeof( BITMAPFILEHEADER );\n fileheader.bfSize = fileheader.bfOffBits + infoheader.bmiHeader.biSizeImage;\n GetDIBits( hdc, bmp, 0, height, ( LPVOID )dwpBits, &amp;infoheader, DIB_RGB_COLORS );\n HANDLE file = CreateFile( path.c_str(), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, \n FILE_ATTRIBUTE_NORMAL, NULL );\n WriteFile( file, &amp;fileheader, sizeof( BITMAPFILEHEADER ), &amp;wb, NULL );\n WriteFile( file, &amp;infoheader.bmiHeader, sizeof( infoheader.bmiHeader ), &amp;wb, NULL );\n WriteFile( file, dwpBits, bitmap.bmWidth bitmap.bmHeight 4, &amp;wb, NULL );\n CloseHandle( file );\n delete [] dwpBits;\n }\n HDC getDC() const { return hdc; }\n int getWidth() const { return width; }\n int getHeight() const { return height; }\n DWORD bits() const { return ( DWORD )pBits; }\nprivate:\n void createPen() {\n if( pen ) DeleteObject( pen );\n pen = CreatePen( PS_SOLID, wid, clr );\n SelectObject( hdc, pen );\n }\n HBITMAP bmp; HDC hdc;\n HPEN pen; HBRUSH brush;\n void pBits; int width, height, wid;\n DWORD clr;\n};\nclass julia {\npublic:\n void draw( std::complex&lt;long double&gt; k ) {\n bmp.create( BMPSIZE, BMPSIZE );\n DWORD bits = bmp.bits();\n int res, pos;\n std::complex&lt;long double&gt; c, factor( FCT / BMP_SIZE, FCT / BMP_SIZE ) ;\n\n for( int y = 0; y &lt; BMP_SIZE; y++ ) {\n pos = y BMPSIZE;\n\n c.imag( ( factor.imag() * y ) + -hFCT );\n\n for( int x = 0; x &lt; BMPSIZE; x++ ) {\n c.real( factor.real() x + -hFCT );\n res = inSet( c, k );\n if( res ) {\n int n_res = res % 255;\n if( res &lt; ( ITERATIONS &gt;&gt; 1 ) ) res = RGB( n_res &lt;&lt; 2, n_res &lt;&lt; 3, n_res &lt;&lt; 4 );\n else res = RGB( n_res &lt;&lt; 4, n_res &lt;&lt; 2, n_res &lt;&lt; 5 );\n }\n bits[pos++] = res;\n }\n }\n bmp.saveBitmap( "./js.bmp" );\n }\nprivate:\n int inSet( std::complex&lt;long double&gt; z, std::complex&lt;long double&gt; c ) {\n long double dist;\n for( int ec = 0; ec &lt; ITERATIONS; ec++ ) {\n z = z z; z = z + c;\n dist = ( z.imag() z.imag() ) + ( z.real() z.real() );\n if( dist &gt; 3 ) return( ec );\n }\n return 0;\n }\n myBitmap bmp;\n};\nint main( int argc, char argv[] ) {\n std::complex&lt;long double&gt; c;\n long double factor = FCT / BMP_SIZE;\n c.imag( ( factor 184 ) + -1.4 );\n c.real( ( factor 307 ) + -2.0 );\n julia j; j.draw( c ); return 0; \n}\n', 'document_id': 0}</code> | <code>{'document': '#include &lt;windows.h&gt;\n#include &lt;ctime&gt;\n#include &lt;string&gt;\n\nconst int BMP_SIZE = 600, ITERATIONS = static_cast&lt;int&gt;( 15e5 );\n\nclass myBitmap {\npublic:\n myBitmap() : pen( NULL ), brush( NULL ), clr( 0 ), wid( 1 ) {}\n ~myBitmap() {\n DeleteObject( pen ); DeleteObject( brush );\n DeleteDC( hdc ); DeleteObject( bmp );\n }\n bool create( int w, int h ) {\n BITMAPINFO bi;\n ZeroMemory( &amp;bi, sizeof( bi ) );\n bi.bmiHeader.biSize = sizeof( bi.bmiHeader );\n bi.bmiHeader.biBitCount = sizeof( DWORD ) 8;\n bi.bmiHeader.biCompression = BIRGB;\n bi.bmiHeader.biPlanes = 1;\n bi.bmiHeader.biWidth = w;\n bi.bmiHeader.biHeight = -h;\n HDC dc = GetDC( GetConsoleWindow() );\n bmp = CreateDIBSection( dc, &amp;bi, DIBRGBCOLORS, &amp;pBits, NULL, 0 );\n if( !bmp ) return false;\n hdc = CreateCompatibleDC( dc );\n SelectObject( hdc, bmp );\n ReleaseDC( GetConsoleWindow(), dc );\n width = w; height = h;\n return true;\n }\n void clear( BYTE clr = 0 ) {\n memset( pBits, clr, width * height * sizeof( DWORD ) );\n }\n void setBrushColor( DWORD bClr ) {\n if( brush ) DeleteObject( brush );\n brush = CreateSolidBrush( bClr );\n SelectObject( hdc, brush );\n }\n void setPenColor( DWORD c ) {\n clr = c; createPen();\n }\n void setPenWidth( int w ) {\n wid = w; createPen();\n }\n void saveBitmap( std::string path ) {\n BITMAPFILEHEADER fileheader;\n BITMAPINFO infoheader;\n BITMAP bitmap;\n DWORD wb;\n GetObject( bmp, sizeof( bitmap ), &amp;bitmap );\n DWORD* dwpBits = new DWORD[bitmap.bmWidth * bitmap.bmHeight];\n ZeroMemory( dwpBits, bitmap.bmWidth * bitmap.bmHeight * sizeof( DWORD ) );\n ZeroMemory( &amp;infoheader, sizeof( BITMAPINFO ) );\n ZeroMemory( &amp;fileheader, sizeof( BITMAPFILEHEADER ) );\n infoheader.bmiHeader.biBitCount = sizeof( DWORD ) * 8;\n infoheader.bmiHeader.biCompression = BIRGB;\n infoheader.bmiHeader.biPlanes = 1;\n infoheader.bmiHeader.biSize = sizeof( infoheader.bmiHeader );\n infoheader.bmiHeader.biHeight = bitmap.bmHeight;\n infoheader.bmiHeader.biWidth = bitmap.bmWidth;\n infoheader.bmiHeader.biSizeImage = bitmap.bmWidth bitmap.bmHeight sizeof( DWORD );\n fileheader.bfType = 0x4D42;\n fileheader.bfOffBits = sizeof( infoheader.bmiHeader ) + sizeof( BITMAPFILEHEADER );\n fileheader.bfSize = fileheader.bfOffBits + infoheader.bmiHeader.biSizeImage;\n GetDIBits( hdc, bmp, 0, height, ( LPVOID )dwpBits, &amp;infoheader, DIBRGBCOLORS );\n HANDLE file = CreateFile( path.cstr(), GENERICWRITE, 0, NULL, CREATEALWAYS, \n FILEATTRIBUTENORMAL, NULL );\n WriteFile( file, &amp;fileheader, sizeof( BITMAPFILEHEADER ), &amp;wb, NULL );\n WriteFile( file, &amp;infoheader.bmiHeader, sizeof( infoheader.bmiHeader ), &amp;wb, NULL );\n WriteFile( file, dwpBits, bitmap.bmWidth * bitmap.bmHeight * 4, &amp;wb, NULL );\n CloseHandle( file );\n delete [] dwpBits;\n }\n HDC getDC() const { return hdc; }\n int getWidth() const { return width; }\n int getHeight() const { return height; }\nprivate:\n void createPen() {\n if( pen ) DeleteObject( pen );\n pen = CreatePen( PSSOLID, wid, clr );\n SelectObject( hdc, pen );\n }\n HBITMAP bmp; HDC hdc;\n HPEN pen; HBRUSH brush;\n void pBits; int width, height, wid;\n DWORD clr;\n};\nclass fern {\npublic:\n void draw() {\n bmp.create( BMP_SIZE, BMP_SIZE );\n float x = 0, y = 0; HDC dc = bmp.getDC();\n int hs = BMP_SIZE &gt;&gt; 1;\n for( int f = 0; f &lt; ITERATIONS; f++ ) {\n SetPixel( dc, hs + static_cast&lt;int&gt;( x 55.f ), \n BMPSIZE - 15 - staticcast&lt;int&gt;( y 55.f ), \n RGB( static_cast&lt;int&gt;( rnd() 80.f ) + 20, \n staticcast&lt;int&gt;( rnd() * 128.f ) + 128, \n staticcast&lt;int&gt;( rnd() 80.f ) + 30 ) ); \n getXY( x, y );\n }\n bmp.saveBitmap( "./bf.bmp" );\n }\nprivate:\n void getXY( float&amp; x, float&amp; y ) {\n float g, xl, yl;\n g = rnd();\n if( g &lt; .01f ) { xl = 0; yl = .16f y; } \n else if( g &lt; .07f ) {\n xl = .2f x - .26f y;\n yl = .23f x + .22f y + 1.6f;\n } else if( g &lt; .14f ) {\n xl = -.15f x + .28f y;\n yl = .26f x + .24f y + .44f;\n } else {\n xl = .85f x + .04f y;\n yl = -.04f x + .85f y + 1.6f;\n }\n x = xl; y = yl;\n }\n float rnd() {\n return staticcast&lt;float&gt;( rand() ) / staticcast&lt;float&gt;( RANDMAX );\n }\n myBitmap bmp;\n};\nint main( int argc, char* argv[]) {\n srand( staticcast&lt;unsigned&gt;( time( 0 ) ) );\n fern f; f.draw(); return 0; \n}\n', 'document_id': 449}</code> |
  • Loss: <code>pylate.losses.contrastive.Contrastive</code>
codetransdl
  • Dataset: codetransdl at 68d15dc
  • Size: 564 training samples
  • Approximate statistics based on the first 564 samples: | | query | positive | negative0 | negative1 | negative2 | negative3 | negative4 | negative5 | negative6 | negative7 | negative8 | negative9 | negative10 | negative11 | negative12 | negative13 | negative14 | negative15 | negative16 | negative17 | negative18 | negative19 | negative20 | negative21 | negative22 | negative23 | negative24 | negative25 | negative26 | negative27 | negative28 | negative29 | negative30 | negative31 | negative32 | negative33 | negative34 | negative35 | negative36 | negative37 | negative38 | negative39 | negative40 | negative41 | negative42 | negative43 | negative44 | negative45 | negative46 | negative47 | negative48 | negative49 | |:--------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------| | type | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | | details | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
  • Samples: | query | positive | negative0 | |:------|:---------|:-----------| | <code>{'query': 'x = tf.range(12)\ntf.size(x)\nX = tf.reshape(x, (3, 4))\ntf.zeros((2, 3, 4))\ntf.ones((2, 3, 4))\ntf.random.normal(shape=[3, 4])\ntf.constant([[2, 1, 4, 3], [1, 2, 3, 4], [4, 3, 2, 1]])\nx = tf.constant([1.0, 2, 4, 8])\ny = tf.constant([2.0, 2, 2, 2])\nx + y, x - y, x * y, x / y, x ** y\ntf.exp(x)\nX = tf.reshape(tf.range(12, dtype=tf.float32), (3, 4))\nY = tf.constant([[2.0, 1, 4, 3], [1, 2, 3, 4], [4, 3, 2, 1]])\ntf.concat([X, Y], axis=0), tf.concat([X, Y], axis=1)\ntf.reducesum(X)\na = tf.reshape(tf.range(3), (3, 1))\nb = tf.reshape(tf.range(2), (1, 2))\nXvar = tf.Variable(X)\nXvar[1, 2].assign(9)\nXvar = tf.Variable(X)\nXvar[0:2, :].assign(tf.ones(Xvar[0:2,:].shape, dtype = tf.float32) * 12)\nZ = tf.Variable(tf.zeroslike(Y))\nZ.assign(X + Y)\n@tf.function\ndef computation(X, Y):\n Z = tf.zeroslike(Y)\n A = X + Y\n B = A + Y\n C = B + Y\n return C + Y\ncomputation(X, Y)\nA = X.numpy()\nB = tf.constant(A)\na = tf.constant([3.5]).numpy()\nprint(a, a.item(), float(a), int(a))', 'queryid': 0}</code> | <code>{'document': "x = paddle.arange(12)\nx.numel()\nX = paddle.reshape(x, (3, 4))\npaddle.zeros((2, 3, 4))\npaddle.ones((2, 3, 4))\npaddle.randn((3, 4),'float32')\npaddle.totensor([[2, 1, 4, 3], [1, 2, 3, 4], [4, 3, 2, 1]])\nx = paddle.totensor([1.0, 2, 4, 8])\ny = paddle.totensor([2, 2, 2, 2])\nx + y, x - y, x * y, x / y, x**y\npaddle.exp(x)\nX = paddle.arange(12, dtype='float32').reshape((3, 4))\nY = paddle.totensor([[2.0, 1, 4, 3], [1, 2, 3, 4], [4, 3, 2, 1]])\npaddle.concat((X, Y), axis=0), paddle.concat((X, Y), axis=1)\nX.sum()\na = paddle.reshape(paddle.arange(3), (3, 1))\nb = paddle.reshape(paddle.arange(2), (1, 2))\nX[1, 2] = 9\nX[0:2, :] = 12\nZ = paddle.zeroslike(Y)\nZ = X + Y\nbefore = id(X)\nX += Y\nid(X) == before\nA = X.numpy()\nB = paddle.totensor(A)\ntype(A), type(B)\na = paddle.totensor([3.5])\na, a.item(), float(a), int(a)", 'documentid': 0}</code> | <code>{'document': 'x = torch.arange(12)\nx.numel()\nX = x.reshape(3, 4)\ntorch.zeros((2, 3, 4))\ntorch.ones((2, 3, 4))\ntorch.randn(3, 4)\ntorch.tensor([[2, 1, 4, 3], [1, 2, 3, 4], [4, 3, 2, 1]])\nx = torch.tensor([1.0, 2, 4, 8])\ny = torch.tensor([2, 2, 2, 2])\nx + y, x - y, x y, x / y, x * y\ntorch.exp(x)\nX = torch.arange(12, dtype=torch.float32).reshape((3,4))\nY = torch.tensor([[2.0, 1, 4, 3], [1, 2, 3, 4], [4, 3, 2, 1]])\ntorch.cat((X, Y), dim=0), torch.cat((X, Y), dim=1)\nX.sum()\na = torch.arange(3).reshape((3, 1))\nb = torch.arange(2).reshape((1, 2))\nX[1, 2] = 9\nX[0:2, :] = 12\nZ = torch.zeroslike(Y)\nZ[:] = X + Y\nbefore = id(X)\nX += Y\nid(X) == before\nA = X.numpy()\nB = torch.tensor(A)\na = torch.tensor([3.5])\nprint(a, a.item(), float(a), int(a))', 'documentid': 188}</code> |
  • Loss: <code>pylate.losses.contrastive.Contrastive</code>
CodeSearchNet_go
  • Dataset: CodeSearchNet_go at 9f89bdc
  • Size: 166,972 training samples
  • Approximate statistics based on the first 1000 samples: | | query | positive | negative0 | negative1 | negative2 | negative3 | negative4 | negative5 | negative6 | negative7 | negative8 | negative9 | negative10 | negative11 | negative12 | negative13 | negative14 | negative15 | negative16 | negative17 | negative18 | negative19 | negative20 | negative21 | negative22 | negative23 | negative24 | negative25 | negative26 | negative27 | negative28 | negative29 | negative30 | negative31 | negative32 | negative33 | negative34 | negative35 | negative36 | negative37 | negative38 | negative39 | negative40 | negative41 | negative42 | negative43 | negative44 | negative45 | negative46 | negative47 | negative48 | negative49 | |:--------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------| | type | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | | details | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
  • Samples: | query | positive | negative0 | |:------|:---------|:-----------| | <code>{'query': 'getStringValue func getStringValue(b []rune) (int, error) {\n\tif b[0] != \'"\' {\n\t\treturn 0, NewParseError("strings must start with \'\\"\'")\n\t}\n\n\tendQuote := false\n\ti := 1\n\n\tfor ; i &lt; len(b) &amp;&amp; !endQuote; i++ {\n\t\tif escaped := isEscaped(b[:i], b[i]); b[i] == \'"\' &amp;&amp; !escaped {\n\t\t\tendQuote = true\n\t\t\tbreak\n\t\t} else if escaped {\n\t\t\t/*c, err := getEscapedByte(b[i])\n\t\t\tif err != nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\n\t\t\tb[i-1] = c\n\t\t\tb = append(b[:i], b[i+1:]...)\n\t\t\ti--*/\n\n\t\t\tcontinue\n\t\t}\n\t}\n\n\tif !endQuote {\n\t\treturn 0, NewParseError("missing \'\\"\' in string value")\n\t}\n\n\treturn i + 1, nil\n}', 'queryid': 0}</code> | <code>{'document': '// getStringValue will return a quoted string and the amount\n// of bytes read\n//\n// an error will be returned if the string is not properly formatted', 'documentid': 0}</code> | <code>{'document': '// stringValue returns the string value of string literal e.', 'documentid': 18454}</code> |
  • Loss: <code>pylate.losses.contrastive.Contrastive</code>
CodeSearchNet_java
  • Dataset: CodeSearchNet_java at 9f89bdc
  • Size: 162,773 training samples
  • Approximate statistics based on the first 1000 samples: | | query | positive | negative0 | negative1 | negative2 | negative3 | negative4 | negative5 | negative6 | negative7 | negative8 | negative9 | negative10 | negative11 | negative12 | negative13 | negative14 | negative15 | negative16 | negative17 | negative18 | negative19 | negative20 | negative21 | negative22 | negative23 | negative24 | negative25 | negative26 | negative27 | negative28 | negative29 | negative30 | negative31 | negative32 | negative33 | negative34 | negative35 | negative36 | negative37 | negative38 | negative39 | negative40 | negative41 | negative42 | negative43 | negative44 | negative45 | negative46 | negative47 | negative48 | negative49 | |:--------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------| | type | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | | details | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
  • Samples: | query | positive | negative0 | |:------|:---------|:-----------| | <code>{'query': 'SCryptUtil.check public static boolean check(String passwd, String hashed) {\n try {\n String[] parts = hashed.split("\\\\$");\n\n if (parts.length != 5 \|\| !parts[1].equals("s0")) {\n throw new IllegalArgumentException("Invalid hashed value");\n }\n\n long params = Long.parseLong(parts[2], 16);\n byte[] salt = decode(parts[3].toCharArray());\n byte[] derived0 = decode(parts[4].toCharArray());\n\n int N = (int) Math.pow(2, params &gt;&gt; 16 &amp; 0xffff);\n int r = (int) params &gt;&gt; 8 &amp; 0xff;\n int p = (int) params &amp; 0xff;\n\n byte[] derived1 = SCrypt.scrypt(passwd.getBytes("UTF-8"), salt, N, r, p, 32);\n\n if (derived0.length != derived1.length) return false;\n\n int result = 0;\n for (int i = 0; i &lt; derived0.length; i++) {\n result \|= derived0[i] ^ derived1[i];\n }\n return result == 0;\n } catch (UnsupportedEncodingException e) {\n throw new IllegalStateException("JVM doesn\'t support UTF-8?");\n } catch (GeneralSecurityException e) {\n throw new IllegalStateException("JVM doesn\'t support SHA1PRNG or HMACSHA256?");\n }\n }', 'queryid': 0}</code> | <code>{'document': 'Compare the supplied plaintext password to a hashed password.\n\n@param passwd Plaintext password.\n@param hashed scrypt hashed password.\n\n@return true if passwd matches hashed value.', 'documentid': 0}</code> | <code>{'document': 'Compute the the hash value for the String.\n\n@param passwd\nthe password String\n@return\nthe Hash digest byte.\n@throws NoSuchAlgorithmException\nthe NoSuchAlgorithmException.', 'document_id': 86052}</code> |
  • Loss: <code>pylate.losses.contrastive.Contrastive</code>
CodeSearchNet_javascript
  • Dataset: CodeSearchNet_javascript at 9f89bdc
  • Size: 56,734 training samples
  • Approximate statistics based on the first 1000 samples: | | query | positive | negative0 | negative1 | negative2 | negative3 | negative4 | negative5 | negative6 | negative7 | negative8 | negative9 | negative10 | negative11 | negative12 | negative13 | negative14 | negative15 | negative16 | negative17 | negative18 | negative19 | negative20 | negative21 | negative22 | negative23 | negative24 | negative25 | negative26 | negative27 | negative28 | negative29 | negative30 | negative31 | negative32 | negative33 | negative34 | negative35 | negative36 | negative37 | negative38 | negative39 | negative40 | negative41 | negative42 | negative43 | negative44 | negative45 | negative46 | negative47 | negative48 | negative49 | |:--------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------| | type | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | | details | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
  • Samples: | query | positive | negative0 | |:------|:---------|:-----------| | <code>{'query': 'function (state, action) {\n return .defaults({\n isValidating: action.isValidating,\n lastAction: ISVALIDATING\n }, state)\n }', 'queryid': 0}</code> | <code>{'document': 'Update is validating result\n@param {State} state - state to update\n@param {Action} action - action\n@returns {State} - updated state', 'documentid': 0}</code> | <code>{'document': 'Updates state with newsletter settings submit error\nHolds information only for latest request\n\n@param {Object} state Current state\n@param {Object} action Action\n@return {Object} Updated state', 'documentid': 58211}</code> |
  • Loss: <code>pylate.losses.contrastive.Contrastive</code>
CodeSearchNet_php
  • Dataset: CodeSearchNet_php at 9f89bdc
  • Size: 240,327 training samples
  • Approximate statistics based on the first 1000 samples: | | query | positive | negative0 | negative1 | negative2 | negative3 | negative4 | negative5 | negative6 | negative7 | negative8 | negative9 | negative10 | negative11 | negative12 | negative13 | negative14 | negative15 | negative16 | negative17 | negative18 | negative19 | negative20 | negative21 | negative22 | negative23 | negative24 | negative25 | negative26 | negative27 | negative28 | negative29 | negative30 | negative31 | negative32 | negative33 | negative34 | negative35 | negative36 | negative37 | negative38 | negative39 | negative40 | negative41 | negative42 | negative43 | negative44 | negative45 | negative46 | negative47 | negative48 | negative49 | |:--------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------| | type | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | | details | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
  • Samples: | query | positive | negative0 | |:------|:---------|:-----------| | <code>{'query': 'BreadcrumbCollection.addOne public function addOne($title, $url, array $data = [])\n {\n return $this-&gt;addBreadcrumb(\n BreadcrumbItem::make($title, $url, $data)\n );\n }', 'queryid': 0}</code> | <code>{'document': 'Add a breadcrumb item to collection.\n\n@param string $title\n@param string $url\n@param array $data\n\n@return self', 'documentid': 0}</code> | <code>{'document': 'Add a breadcrumb to the collection.\n\n@param string $title\n@param string $url\n@return void', 'documentid': 135797}</code> |
  • Loss: <code>pylate.losses.contrastive.Contrastive</code>
CodeSearchNet_python
  • Dataset: CodeSearchNet_python at 9f89bdc
  • Size: 251,063 training samples
  • Approximate statistics based on the first 1000 samples: | | query | positive | negative0 | negative1 | negative2 | negative3 | negative4 | negative5 | negative6 | negative7 | negative8 | negative9 | negative10 | negative11 | negative12 | negative13 | negative14 | negative15 | negative16 | negative17 | negative18 | negative19 | negative20 | negative21 | negative22 | negative23 | negative24 | negative25 | negative26 | negative27 | negative28 | negative29 | negative30 | negative31 | negative32 | negative33 | negative34 | negative35 | negative36 | negative37 | negative38 | negative39 | negative40 | negative41 | negative42 | negative43 | negative44 | negative45 | negative46 | negative47 | negative48 | negative49 | |:--------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------| | type | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | | details | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
  • Samples: | query | positive | negative0 | |:------|:---------|:-----------| | <code>{'query': 'AbstractElement.settext def settext(self, text, cls=\'current\'):\n """Set the text for this element.\n\n Arguments:\n text (str): The text\n cls (str): The class of the text, defaults to ``current`` (leave this unless you know what you are doing). There may be only one text content element of each class associated with the element.\n """\n self.replace(TextContent, value=text, cls=cls)', 'queryid': 0}</code> | <code>{'document': 'Set the text for this element.\n\n Arguments:\n text (str): The text\n cls (str): The class of the text, defaults to `current` (leave this unless you know what you are doing). There may be only one text content element of each class associated with the element.', 'documentid': 0}</code> | <code>{'document': 'Set text value as sole Text child node of element; any existing\n Text nodes are removed', 'documentid': 107570}</code> |
  • Loss: <code>pylate.losses.contrastive.Contrastive</code>
CodeSearchNet_ruby
  • Dataset: CodeSearchNet_ruby at 9f89bdc
  • Size: 24,731 training samples
  • Approximate statistics based on the first 1000 samples: | | query | positive | negative0 | negative1 | negative2 | negative3 | negative4 | negative5 | negative6 | negative7 | negative8 | negative9 | negative10 | negative11 | negative12 | negative13 | negative14 | negative15 | negative16 | negative17 | negative18 | negative19 | negative20 | negative21 | negative22 | negative23 | negative24 | negative25 | negative26 | negative27 | negative28 | negative29 | negative30 | negative31 | negative32 | negative33 | negative34 | negative35 | negative36 | negative37 | negative38 | negative39 | negative40 | negative41 | negative42 | negative43 | negative44 | negative45 | negative46 | negative47 | negative48 | negative49 | |:--------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------| | type | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | | details | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
  • Samples: | query | positive | negative0 | |:------|:---------|:-----------| | <code>{'query': 'CelluloidPubsub.Reactor.handleparsedwebsocketmessage def handleparsedwebsocketmessage(jsondata)\n data = jsondata.isa?(Hash) ? jsondata.stringifykeys : {}\n if CelluloidPubsub::Reactor::AVAILABLEACTIONS.include?(data[\'clientaction\'].tos)\n logdebug "#{self.class} finds actions for #{jsondata}"\n delegateaction(data) if data[\'clientaction\'].present?\n else\n handleunknownaction(data[\'channel\'], jsondata)\n end\n end', 'queryid': 0}</code> | <code>{'document': 'method that checks if the data is a Hash\n\n if the data is a hash then will stringify the keys and will call the method {#delegateaction}\n that will handle the message, otherwise will call the method {#handleunknownaction}\n\n @see #delegateaction\n @see #handleunknownaction\n\n @param [Hash] jsondata\n\n @return [void]\n\n @api public', 'documentid': 0}</code> | <code>{'document': "If the message can be parsed into a Hash it will respond to the reactor's websocket connection with the same message in JSON format\n otherwise will try send the message how it is and escaped into JSON format\n\n @param [CelluloidPubsub::Reactor] reactor The reactor that received an unhandled message\n @param [Object] data The message that the reactor could not handle\n\n @return [void]\n\n @api public", 'documentid': 24862}</code> |
  • Loss: <code>pylate.losses.contrastive.Contrastive</code>
CodeSearchNetccrgo
  • Dataset: CodeSearchNet_ccr_go at 9f89bdc
  • Size: 167,278 training samples
  • Approximate statistics based on the first 1000 samples: | | query | positive | negative0 | negative1 | negative2 | negative3 | negative4 | negative5 | negative6 | negative7 | negative8 | negative9 | negative10 | negative11 | negative12 | negative13 | negative14 | negative15 | negative16 | negative17 | negative18 | negative19 | negative20 | negative21 | negative22 | negative23 | negative24 | negative25 | negative26 | negative27 | negative28 | negative29 | negative30 | negative31 | negative32 | negative33 | negative34 | negative35 | negative36 | negative37 | negative38 | negative39 | negative40 | negative41 | negative42 | negative43 | negative44 | negative45 | negative46 | negative47 | negative48 | negative49 | |:--------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------| | type | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | | details | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
  • Samples: | query | positive | negative0 | |:------|:---------|:-----------| | <code>{'query': 'getStringValue func getStringValue(b []rune) (int, error) {\n\tif b[0] != \'"\' {\n\t\treturn 0, NewParseError("strings must start with \'\\"\'")\n\t}\n\n\tendQuote := false\n\ti := 1\n\n\tfor ; i &lt; len(b) &amp;&amp; !endQuote; i++ {\n\t\tif escaped := isEscaped(b[:i], b[i]); b[i] == \'"\' &amp;&amp; !escaped {\n\t\t\tendQuote = true\n\t\t\tbreak\n\t\t} else if escaped {\n\t\t\t/*c, err := getEscapedByte(b[i])\n\t\t\tif err !=', 'queryid': 0}</code> | <code>{'document': ' nil {\n\t\t\t\treturn 0, err\n\t\t\t}\n\n\t\t\tb[i-1] = c\n\t\t\tb = append(b[:i], b[i+1:]...)\n\t\t\ti--*/\n\n\t\t\tcontinue\n\t\t}\n\t}\n\n\tif !endQuote {\n\t\treturn 0, NewParseError("missing \'\\"\' in string value")\n\t}\n\n\treturn i + 1, nil\n}', 'documentid': 0}</code> | <code>{'document': '\t\t\treturn 0, "", fmt.Errorf("nothing following final escape in %q", s)\n\t\t\t}\n\t\t\tb = s[i]\n\t\t}\n\t\tunesc = append(unesc, b)\n\t}\n\treturn i, string(unesc), nil\n}', 'documentid': 153298}</code> |
  • Loss: <code>pylate.losses.contrastive.Contrastive</code>
CodeSearchNetccrjava
  • Dataset: CodeSearchNet_ccr_java at 9f89bdc
  • Size: 164,900 training samples
  • Approximate statistics based on the first 1000 samples: | | query | positive | negative0 | negative1 | negative2 | negative3 | negative4 | negative5 | negative6 | negative7 | negative8 | negative9 | negative10 | negative11 | negative12 | negative13 | negative14 | negative15 | negative16 | negative17 | negative18 | negative19 | negative20 | negative21 | negative22 | negative23 | negative24 | negative25 | negative26 | negative27 | negative28 | negative29 | negative30 | negative31 | negative32 | negative33 | negative34 | negative35 | negative36 | negative37 | negative38 | negative39 | negative40 | negative41 | negative42 | negative43 | negative44 | negative45 | negative46 | negative47 | negative48 | negative49 | |:--------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------| | type | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | | details | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
  • Samples: | query | positive | negative0 | |:------|:---------|:-----------| | <code>{'query': 'SCryptUtil.check public static boolean check(String passwd, String hashed) {\n try {\n String[] parts = hashed.split("\\\\$");\n\n if (parts.length != 5 \|\| !parts[1].equals("s0")) {\n throw new IllegalArgumentException("Invalid hashed value");\n }\n\n long params = Long.parseLong(parts[2], 16);\n byte[] salt = decode(parts[3].toCharArray());\n byte[] derived0 = decode(parts[4].toCharArray());\n\n int N = (int) Math.pow(2, params &gt;&gt; 16 &amp; 0xffff);\n ', 'queryid': 0}</code> | <code>{'document': ' int r = (int) params &gt;&gt; 8 &amp; 0xff;\n int p = (int) params &amp; 0xff;\n\n byte[] derived1 = SCrypt.scrypt(passwd.getBytes("UTF-8"), salt, N, r, p, 32);\n\n if (derived0.length != derived1.length) return false;\n\n int result = 0;\n for (int i = 0; i &lt; derived0.length; i++) {\n result \|= derived0[i] ^ derived1[i];\n }\n return result == 0;\n } catch (UnsupportedEncodingException e) {\n throw new IllegalStateException("JVM doesn\'t support UTF-8?");\n } catch (GeneralSecurityException e) {\n throw new IllegalStateException("JVM doesn\'t support SHA1PRNG or HMACSHA256?");\n }\n }', 'documentid': 0}</code> | <code>{'document': '\n } catch (Exception e) {\n throw new IllegalStateException("Validity checks failed for pass: " + passName, e);\n }\n }', 'document_id': 148733}</code> |
  • Loss: <code>pylate.losses.contrastive.Contrastive</code>
CodeSearchNetccrjavascript
  • Dataset: CodeSearchNet_ccr_javascript at 9f89bdc
  • Size: 58,017 training samples
  • Approximate statistics based on the first 1000 samples: | | query | positive | negative0 | negative1 | negative2 | negative3 | negative4 | negative5 | negative6 | negative7 | negative8 | negative9 | negative10 | negative11 | negative12 | negative13 | negative14 | negative15 | negative16 | negative17 | negative18 | negative19 | negative20 | negative21 | negative22 | negative23 | negative24 | negative25 | negative26 | negative27 | negative28 | negative29 | negative30 | negative31 | negative32 | negative33 | negative34 | negative35 | negative36 | negative37 | negative38 | negative39 | negative40 | negative41 | negative42 | negative43 | negative44 | negative45 | negative46 | negative47 | negative48 | negative49 | |:--------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------| | type | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | | details | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
  • Samples: | query | positive | negative0 | |:------|:---------|:-----------| | <code>{'query': 'function (state, action) {\n return .defaults({\n ', 'queryid': 0}</code> | <code>{'document': ' isValidating: action.isValidating,\n lastAction: ISVALIDATING\n }, state)\n }', 'documentid': 0}</code> | <code>{'document': ' baz: action.payload,\n };\n default:\n return state;\n }\n}', 'documentid': 47204}</code> |
  • Loss: <code>pylate.losses.contrastive.Contrastive</code>
CodeSearchNetccrphp
  • Dataset: CodeSearchNet_ccr_php at 9f89bdc
  • Size: 241,177 training samples
  • Approximate statistics based on the first 1000 samples: | | query | positive | negative0 | negative1 | negative2 | negative3 | negative4 | negative5 | negative6 | negative7 | negative8 | negative9 | negative10 | negative11 | negative12 | negative13 | negative14 | negative15 | negative16 | negative17 | negative18 | negative19 | negative20 | negative21 | negative22 | negative23 | negative24 | negative25 | negative26 | negative27 | negative28 | negative29 | negative30 | negative31 | negative32 | negative33 | negative34 | negative35 | negative36 | negative37 | negative38 | negative39 | negative40 | negative41 | negative42 | negative43 | negative44 | negative45 | negative46 | negative47 | negative48 | negative49 | |:--------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------| | type | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | | details | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
  • Samples: | query | positive | negative0 | |:------|:---------|:-----------| | <code>{'query': 'BreadcrumbCollection.addOne public function addOne($title, $url, array $data = [])\n {\n ', 'queryid': 0}</code> | <code>{'document': ' return $this-&gt;addBreadcrumb(\n BreadcrumbItem::make($title, $url, $data)\n );\n }', 'documentid': 0}</code> | <code>{'document': ' $this-&gt;breadcrumbs-&gt;push(new Breadcrumb($title, $url));\n }', 'documentid': 135797}</code> |
  • Loss: <code>pylate.losses.contrastive.Contrastive</code>
CodeSearchNetccrpython
  • Dataset: CodeSearchNet_ccr_python at 9f89bdc
  • Size: 251,758 training samples
  • Approximate statistics based on the first 1000 samples: | | query | positive | negative0 | negative1 | negative2 | negative3 | negative4 | negative5 | negative6 | negative7 | negative8 | negative9 | negative10 | negative11 | negative12 | negative13 | negative14 | negative15 | negative16 | negative17 | negative18 | negative19 | negative20 | negative21 | negative22 | negative23 | negative24 | negative25 | negative26 | negative27 | negative28 | negative29 | negative30 | negative31 | negative32 | negative33 | negative34 | negative35 | negative36 | negative37 | negative38 | negative39 | negative40 | negative41 | negative42 | negative43 | negative44 | negative45 | negative46 | negative47 | negative48 | negative49 | |:--------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------| | type | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | | details | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
  • Samples: | query | positive | negative0 | |:------|:---------|:-----------| | <code>{'query': 'AbstractElement.settext def settext(self, text, cls=\'current\'):\n """Set the text for this element.\n\n Arguments:\n text (str): The text\n cls (str): The class of the text, defaults to ``current`` (leave this unless you know what you are doing). There may be', 'queryid': 0}</code> | <code>{'document': ' only one text content element of each class associated with the element.\n """\n self.replace(TextContent, value=text, cls=cls)', 'documentid': 0}</code> | <code>{'document': '\n Jython and has been superseded by the \'ast\' module in Python 2.6 and\n later.\n """\n return cls.interpret(parser.expr(text).totuple(1)[1])', 'documentid': 276506}</code> |
  • Loss: <code>pylate.losses.contrastive.Contrastive</code>
CodeSearchNetccrruby
  • Dataset: CodeSearchNet_ccr_ruby at 9f89bdc
  • Size: 24,918 training samples
  • Approximate statistics based on the first 1000 samples: | | query | positive | negative0 | negative1 | negative2 | negative3 | negative4 | negative5 | negative6 | negative7 | negative8 | negative9 | negative10 | negative11 | negative12 | negative13 | negative14 | negative15 | negative16 | negative17 | negative18 | negative19 | negative20 | negative21 | negative22 | negative23 | negative24 | negative25 | negative26 | negative27 | negative28 | negative29 | negative30 | negative31 | negative32 | negative33 | negative34 | negative35 | negative36 | negative37 | negative38 | negative39 | negative40 | negative41 | negative42 | negative43 | negative44 | negative45 | negative46 | negative47 | negative48 | negative49 | |:--------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------|:-------------------| | type | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | dict | | details | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | |
  • Samples: | query | positive | negative0 | |:------|:---------|:-----------| | <code>{'query': 'CelluloidPubsub.Reactor.handleparsedwebsocketmessage def handleparsedwebsocketmessage(jsondata)\n data = jsondata.isa?(Hash) ? jsondata.stringifykeys : {}\n if CelluloidPubsub::Reactor::AVAILABLEACTIONS.include?(data[\'clientaction\'].tos)\n logdebug "#{self.class} finds actions for #{jsondata}"\n ', 'queryid': 0}</code> | <code>{'document': " delegateaction(data) if data['clientaction'].present?\n else\n handleunknownaction(data['channel'], jsondata)\n end\n end", 'documentid': 0}</code> | <code>{'document': ' elsif data[\'method\']\n # RPC notice.\n event = { name: data[\'method\'], data: data[\'params\'] }\n @events &lt;&lt; event\n return nil\n else\n close\n raise RuntimeError, "Unexpected / invalid RPC message #{data.inspect}"\n end\n end', 'document_id': 3560}</code> |
  • Loss: <code>pylate.losses.contrastive.Contrastive</code>

Training Hyperparameters

Non-Default Hyperparameters
  • eval_strategy: steps
  • per_device_train_batch_size: 128
  • per_device_eval_batch_size: 128
  • learning_rate: 3e-05
  • num_train_epochs: 1
  • bf16: True
  • dataloader_num_workers: 8
  • accelerator_config: {'splitbatches': True, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}
All Hyperparameters

<details><summary>Click to expand</summary>

  • overwrite_output_dir: False
  • do_predict: False
  • eval_strategy: steps
  • prediction_loss_only: True
  • per_device_train_batch_size: 128
  • per_device_eval_batch_size: 128
  • per_gpu_train_batch_size: None
  • per_gpu_eval_batch_size: None
  • gradient_accumulation_steps: 1
  • eval_accumulation_steps: None
  • torch_empty_cache_steps: None
  • learning_rate: 3e-05
  • weight_decay: 0.0
  • adam_beta1: 0.9
  • adam_beta2: 0.999
  • adam_epsilon: 1e-08
  • max_grad_norm: 1.0
  • num_train_epochs: 1
  • max_steps: -1
  • lr_scheduler_type: linear
  • lr_scheduler_kwargs: {}
  • warmup_ratio: 0.0
  • warmup_steps: 0
  • log_level: passive
  • log_level_replica: warning
  • log_on_each_node: True
  • logging_nan_inf_filter: True
  • save_safetensors: True
  • save_on_each_node: False
  • save_only_model: False
  • restore_callback_states_from_checkpoint: False
  • no_cuda: False
  • use_cpu: False
  • use_mps_device: False
  • seed: 42
  • data_seed: None
  • jit_mode_eval: False
  • bf16: True
  • fp16: False
  • fp16_opt_level: O1
  • half_precision_backend: auto
  • bf16_full_eval: False
  • fp16_full_eval: False
  • tf32: None
  • local_rank: 0
  • ddp_backend: None
  • tpu_num_cores: None
  • tpu_metrics_debug: False
  • debug: []
  • dataloader_drop_last: True
  • dataloader_num_workers: 8
  • dataloader_prefetch_factor: None
  • past_index: -1
  • disable_tqdm: False
  • remove_unused_columns: True
  • label_names: None
  • load_best_model_at_end: False
  • ignore_data_skip: False
  • fsdp: []
  • fsdp_min_num_params: 0
  • fsdp_config: {'minnumparams': 0, 'xla': False, 'xlafsdpv2': False, 'xlafsdpgrad_ckpt': False}
  • fsdp_transformer_layer_cls_to_wrap: None
  • accelerator_config: {'splitbatches': True, 'dispatchbatches': None, 'evenbatches': True, 'useseedablesampler': True, 'nonblocking': False, 'gradientaccumulationkwargs': None}
  • parallelism_config: None
  • deepspeed: None
  • label_smoothing_factor: 0.0
  • optim: adamwtorchfused
  • optim_args: None
  • adafactor: False
  • group_by_length: False
  • length_column_name: length
  • project: huggingface
  • trackio_space_id: trackio
  • ddp_find_unused_parameters: None
  • ddp_bucket_cap_mb: None
  • ddp_broadcast_buffers: False
  • dataloader_pin_memory: True
  • dataloader_persistent_workers: False
  • skip_memory_metrics: True
  • use_legacy_prediction_loop: False
  • push_to_hub: False
  • resume_from_checkpoint: None
  • hub_model_id: None
  • hub_strategy: every_save
  • hub_private_repo: None
  • hub_always_push: False
  • hub_revision: None
  • gradient_checkpointing: False
  • gradient_checkpointing_kwargs: None
  • include_inputs_for_metrics: False
  • include_for_metrics: []
  • eval_do_concat_batches: True
  • fp16_backend: auto
  • push_to_hub_model_id: None
  • push_to_hub_organization: None
  • mp_parameters:
  • auto_find_batch_size: False
  • full_determinism: False
  • torchdynamo: None
  • ray_scope: last
  • ddp_timeout: 1800
  • torch_compile: False
  • torch_compile_backend: None
  • torch_compile_mode: None
  • include_tokens_per_second: False
  • include_num_input_tokens_seen: no
  • neftune_noise_alpha: None
  • optim_target_modules: None
  • batch_eval_metrics: False
  • eval_on_start: False
  • use_liger_kernel: False
  • liger_kernel_config: None
  • eval_use_gather_object: False
  • average_tokens_across_devices: True
  • prompts: None
  • batch_sampler: batch_sampler
  • router_mapping: {}
  • learning_rate_mapping: {}

</details>

Training Logs

<details><summary>Click to expand</summary>

EpochStepTraining LossCodeSearchNetPython_MaxSim_ndcg@10CodeSearchNetJavascript_MaxSim_ndcg@10CodeSearchNetGo_MaxSim_ndcg@10CodeSearchNetRuby_MaxSim_ndcg@10CodeSearchNetJava_MaxSim_ndcg@10CodeSearchNetPhp_MaxSim_ndcg@10CodeSearchNet_mean_MaxSim_ndcg@10
0.000014.3841-------
0.039112502.5783-------
0.0781250014.85930.94610.82610.96280.86940.90760.89340.9009
0.117237503.7439-------
0.156250001.1550.93890.82420.96120.86560.89260.89440.8962
0.195362501.2135-------
0.234475001.43620.93800.81730.95940.86620.89560.89450.8952
0.273487500.5526-------
0.3125100000.00120.93980.81780.95770.86400.89690.89290.8948
0.3515112501.5271-------
0.3906125004.94610.93900.81780.96040.86610.89940.89380.8961
0.4297137500.7561-------
0.4687150000.43430.93870.81690.95700.86280.89820.89410.8946
0.5078162500.7035-------
0.5468175000.11230.93650.80660.95870.86540.89300.89410.8924
0.5859187500.6777-------
0.6250200000.53340.93670.81820.96070.86720.90040.89340.8961
0.66402125011.0835-------
0.7031225000.17120.93530.81680.95630.86040.89350.89210.8924
0.7421237502.1508-------
0.7812250000.47210.93690.81380.95640.86620.89220.89160.8929
0.8203262500.0174-------
0.8593275000.11410.93970.81350.95700.86270.89790.89240.8939
0.8984287501.2164-------
0.9374300000.05460.93930.81690.95770.86180.89780.89180.8942

</details>

Framework Versions

  • Python: 3.12.12
  • Sentence Transformers: 5.1.1
  • PyLate: 1.3.4
  • Transformers: 4.57.3
  • PyTorch: 2.9.0+cu128
  • Accelerate: 1.12.0
  • Datasets: 4.4.2
  • Tokenizers: 0.22.2

Citation

BibTeX

LateOn-Code
bibtex
@misc{LateOn-Code,
  title  = {LateOn-Code: a Family of State-Of-The-Art Late Interaction Code Retrieval Models},
  author = {Chaffin, Antoine},
  url    = {https://huggingface.co/collections/lightonai/lateon-code},
  year   = {2026}
}
ColGrep
bibtex
@software{next-plaid,
  title  = {NextPlaid, ColGREP: Multi-vector search, from database to coding agents.},
  url    = {https://github.com/lightonai/next-plaid},
  author = {Raphaël Sourty},
  year   = {2026},
}
CoRNStack
bibtex
@inproceedings{DBLP:conf/iclr/SureshRXNMDJ25,
  author       = {Tarun Suresh and
                  Revanth Gangi Reddy and
                  Yifei Xu and
                  Zach Nussbaum and
                  Andriy Mulyar and
                  Brandon Duderstadt and
                  Heng Ji},
  title        = {CoRNStack: High-Quality Contrastive Data for Better Code Retrieval
                  and Reranking},
  booktitle    = {The Thirteenth International Conference on Learning Representations,
                  {ICLR} 2025, Singapore, April 24-28, 2025},
  publisher    = {OpenReview.net},
  year         = {2025},
  url          = {https://openreview.net/forum?id=iyJOUELYir},
  timestamp    = {Sun, 25 May 2025 21:25:19 +0200},
  biburl       = {https://dblp.org/rec/conf/iclr/SureshRXNMDJ25.bib},
  bibsource    = {dblp computer science bibliography, https://dblp.org}
}
CoIR
bibtex
@inproceedings{li2025coir,
  title     = {Coir: A comprehensive benchmark for code information retrieval models},
  author    = {Li, Xiangyang and Dong, Kuicai and Lee, Yi Quan and Xia, Wei and Zhang, Hao and Dai, Xinyi and Wang, Yasheng and Tang, Ruiming},
  booktitle = {Proceedings of the 63rd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
  pages     = {22074--22091},
  year      = {2025}
}
Sentence Transformers
bibtex
@inproceedings{reimers-2019-sentence-bert,
  title     = "Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks",
  author    = "Reimers, Nils and Gurevych, Iryna",
  booktitle = "Proceedings of the 2019 Conference on Empirical Methods in Natural Language Processing",
  month     = "11",
  year      = "2019",
  publisher = "Association for Computational Linguistics",
  url       = "https://arxiv.org/abs/1908.10084"
}
PyLate
bibtex
@inproceedings{DBLP:conf/cikm/ChaffinS25,
  author       = {Antoine Chaffin and
                  Rapha{"{e}}l Sourty},
  editor       = {Meeyoung Cha and
                  Chanyoung Park and
                  Noseong Park and
                  Carl Yang and
                  Senjuti Basu Roy and
                  Jessie Li and
                  Jaap Kamps and
                  Kijung Shin and
                  Bryan Hooi and
                  Lifang He},
  title        = {PyLate: Flexible Training and Retrieval for Late Interaction Models},
  booktitle    = {Proceedings of the 34th {ACM} International Conference on Information
                  and Knowledge Management, {CIKM} 2025, Seoul, Republic of Korea, November
                  10-14, 2025},
  pages        = {6334--6339},
  publisher    = {{ACM}},
  year         = {2025},
  url          = {https://github.com/lightonai/pylate},
  doi          = {10.1145/3746252.3761608},
}

<!--

Glossary

Clearly define terms in order to be accessible across audiences. -->

<!--

Model Card Authors

Lists the people who create the model card, providing recognition and accountability for the detailed work that goes into its construction. -->

<!--

Model Card Contact

Provides a way for people who have updates to the Model Card, suggestions, or questions, to contact the Model Card authors. -->