Sentence Similarity
sentence-transformers
Safetensors
modernbert
feature-extraction
Generated from Trainer
dataset_size:6960000
loss:MultipleNegativesRankingLoss
text-embeddings-inference
Instructions to use Shuu12121/CodeSearch-ModernBERT-Owl-4.1-Plus with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use Shuu12121/CodeSearch-ModernBERT-Owl-4.1-Plus with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("Shuu12121/CodeSearch-ModernBERT-Owl-4.1-Plus") sentences = [ "Create a function to call with simple and hard types This is done so simple types don't need to check for hard types", "function copyHead(headHtml, doc) {\n var head = doc.getElementsByTagName('head')[0];\n\n if (head.innerHTML == headHtml) {\n // the content is already correct\n return;\n }\n\n jQuery.init(head).empty();\n\n appendHTML(headHtml, head);\n }", "func compress(value float64) int16 {\n\ti := int16(precision*math.Log(1.0+math.Abs(value)) + 0.5)\n\tif value < 0 {\n\t\treturn -1 * i\n\t}\n\treturn i\n}", "function (types, hard) {\n for (var t in types) {\n if (types.hasOwnProperty(t)) {\n (function (prop) {\n Object.defineProperty(props, prop, {\n get: function () {\n for (var i = 0; i < inputs.length; ++i) {\n if (!checkType(prop, inputs[i], hard)) {\n return false;\n }\n }\n return true;\n }\n });\n }(t));\n }\n }\n }" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
Welcome to the community
The community tab is the place to discuss and collaborate with the HF community!