Sentence Similarity
sentence-transformers
Safetensors
modernbert
feature-extraction
dense
Generated from Trainer
dataset_size:283621
loss:CachedMultipleNegativesRankingLoss
Eval Results (legacy)
text-embeddings-inference
Instructions to use benjamintli/modernbert-code-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use benjamintli/modernbert-code-v2 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("benjamintli/modernbert-code-v2") sentences = [ "// Uint is a helper routine that allocates a new uint value to store v and\n// returns a pointer to it. This is useful when assigning optional parameters.", "func (c *Animation) GetCurrentTimeWithParams(v *AnimationGetCurrentTimeParams) (float64, error) {\n\tresp, err := gcdmessage.SendCustomReturn(c.target, c.target.GetSendCh(), &gcdmessage.ParamRequest{Id: c.target.GetId(), Method: \"Animation.getCurrentTime\", Params: v})\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tvar chromeData struct {\n\t\tResult struct {\n\t\t\tCurrentTime float64\n\t\t}\n\t}\n\n\tif resp == nil {\n\t\treturn 0, &gcdmessage.ChromeEmptyResponseErr{}\n\t}\n\n\t// test if error first\n\tcerr := &gcdmessage.ChromeErrorResponse{}\n\tjson.Unmarshal(resp.Data, cerr)\n\tif cerr != nil && cerr.Error != nil {\n\t\treturn 0, &gcdmessage.ChromeRequestErr{Resp: cerr}\n\t}\n\n\tif err := json.Unmarshal(resp.Data, &chromeData); err != nil {\n\t\treturn 0, err\n\t}\n\n\treturn chromeData.Result.CurrentTime, nil\n}", "func Uint(v uint) *uint {\n\tp := new(uint)\n\t*p = v\n\treturn p\n}", "def after_init_app(self, app: FlaskUnchained):\n \"\"\"\n Configure the JSON encoder for Flask to be able to serialize Enums,\n LocalProxy objects, and SQLAlchemy models.\n \"\"\"\n self.set_json_encoder(app)\n app.before_first_request(self.register_model_resources)" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
| epoch,steps,cosine-Accuracy@1,cosine-Accuracy@3,cosine-Accuracy@5,cosine-Accuracy@10,cosine-Precision@1,cosine-Recall@1,cosine-Precision@3,cosine-Recall@3,cosine-Precision@5,cosine-Recall@5,cosine-Precision@10,cosine-Recall@10,cosine-MRR@10,cosine-NDCG@10,cosine-MAP@100 | |
| 0.07220216606498195,20,0.4653509328594999,0.602138596268562,0.646211448153319,0.7034204848331006,0.4653509328594999,0.4653509328594999,0.200712865422854,0.602138596268562,0.12924228963066378,0.646211448153319,0.07034204848331006,0.7034204848331006,0.5443246514242371,0.5827139833743387,0.5506186324547956 | |
| 0.07220216606498195,20,0.6576666666666666,0.7726666666666666,0.806,0.8526666666666667,0.6576666666666666,0.6576666666666666,0.2575555555555556,0.7726666666666666,0.16119999999999998,0.806,0.08526666666666666,0.8526666666666667,0.723276719576719,0.7545271097549687,0.7276719566634071 | |
| 0.1444043321299639,40,0.778,0.861,0.8886666666666667,0.921,0.778,0.778,0.287,0.861,0.1777333333333333,0.8886666666666667,0.09209999999999999,0.921,0.8264429894179893,0.8493411821065848,0.8291636762675826 | |
| 0.21660649819494585,60,0.8173333333333334,0.897,0.92,0.9483333333333334,0.8173333333333334,0.8173333333333334,0.299,0.897,0.184,0.92,0.09483333333333331,0.9483333333333334,0.862376190476191,0.8832507820789117,0.8644152623478286 | |
| 0.2888086642599278,80,0.8383333333333334,0.9076666666666666,0.9326666666666666,0.9556666666666667,0.8383333333333334,0.8383333333333334,0.3025555555555556,0.9076666666666666,0.1865333333333333,0.9326666666666666,0.09556666666666666,0.9556666666666667,0.8785792328042326,0.8973196113468543,0.8802922439109704 | |
| 0.36101083032490977,100,0.8453333333333334,0.9133333333333333,0.9373333333333334,0.9593333333333334,0.8453333333333334,0.8453333333333334,0.30444444444444446,0.9133333333333333,0.18746666666666667,0.9373333333333334,0.09593333333333331,0.9593333333333334,0.8845485449735447,0.9027549254734358,0.8861847071466424 | |
| 0.4332129963898917,120,0.8553333333333333,0.919,0.9426666666666667,0.9643333333333334,0.8553333333333333,0.8553333333333333,0.30633333333333335,0.919,0.1885333333333333,0.9426666666666667,0.09643333333333334,0.9643333333333334,0.8923243386243395,0.9097920168400621,0.893732826708417 | |
| 0.5054151624548736,140,0.8636666666666667,0.928,0.9466666666666667,0.965,0.8636666666666667,0.8636666666666667,0.30933333333333335,0.928,0.18933333333333333,0.9466666666666667,0.0965,0.965,0.8994227513227514,0.9154314498380809,0.9008805751692253 | |
| 0.5776173285198556,160,0.863,0.9283333333333333,0.949,0.9676666666666667,0.863,0.863,0.30944444444444447,0.9283333333333333,0.18979999999999994,0.949,0.09676666666666665,0.9676666666666667,0.899525132275133,0.9161267421062982,0.900910979261593 | |
| 0.6498194945848376,180,0.866,0.9326666666666666,0.949,0.9696666666666667,0.866,0.866,0.31088888888888894,0.9326666666666666,0.1898,0.949,0.09696666666666666,0.9696666666666667,0.9026002645502644,0.9189536320991335,0.9038822166937444 | |
| 0.7220216606498195,200,0.865,0.934,0.9506666666666667,0.9693333333333334,0.865,0.865,0.31133333333333335,0.934,0.1901333333333333,0.9506666666666667,0.09693333333333332,0.9693333333333334,0.902392857142857,0.918781519399648,0.9036680051372578 | |
| 0.7942238267148014,220,0.8676666666666667,0.9353333333333333,0.951,0.97,0.8676666666666667,0.8676666666666667,0.31177777777777776,0.9353333333333333,0.19019999999999998,0.951,0.09699999999999998,0.97,0.9046743386243387,0.9206753306666874,0.9059604860650897 | |
| 0.8664259927797834,240,0.872,0.9353333333333333,0.9546666666666667,0.971,0.872,0.872,0.31177777777777776,0.9353333333333333,0.19093333333333332,0.9546666666666667,0.09709999999999998,0.971,0.907424074074074,0.9229967666674856,0.9086851430619863 | |
| 0.9386281588447654,260,0.873,0.9366666666666666,0.9543333333333334,0.973,0.873,0.873,0.31222222222222223,0.9366666666666666,0.19086666666666663,0.9543333333333334,0.0973,0.973,0.9082900793650796,0.9240732170821061,0.9093847853022148 | |