Sentence Similarity
sentence-transformers
Safetensors
modernbert
feature-extraction
dense
Generated from Trainer
dataset_size:58800
loss:MultipleNegativesRankingLoss
text-embeddings-inference
Instructions to use Shuu12121/CodeSearch-ModernBERT-Finch with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use Shuu12121/CodeSearch-ModernBERT-Finch with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("Shuu12121/CodeSearch-ModernBERT-Finch") sentences = [ "Returns boolean indicating whether the requestUrl matches against the paths configured.\n\n@param requestedUrl - url requested by user\n@param opts - unless configuration\n@returns {boolean}", "def xmoe2_v1_l4k_global_only():\n \"\"\"\"\"\"\n hparams = xmoe2_v1_l4k()\n hparams.decoder_layers = [\n \"att\" if l == \"local_att\" else l for l in hparams.decoder_layers]\n return hparams", "function matchesPath(requestedUrl, opts) {\n var paths = !opts.path || Array.isArray(opts.path) ?\n opts.path : [opts.path];\n\n if (paths) {\n return paths.some(function(p) {\n return (typeof p === 'string' && p === requestedUrl.pathname) ||\n (p instanceof RegExp && !! p.exec(requestedUrl.pathname));\n });\n }\n\n return false;\n}", "public static function factory($accessToken, $currentTeam)\n {\n $client = Client::factory($accessToken);\n\n return new self($client, $currentTeam);\n }" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
File size: 1,293 Bytes
18ab014 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | {
"architectures": [
"ModernBertModel"
],
"attention_bias": false,
"attention_dropout": 0.0,
"attention_probs_dropout_prob": 0.1,
"bos_token_id": 30000,
"classifier_activation": "gelu",
"classifier_bias": false,
"classifier_dropout": 0.0,
"classifier_pooling": "cls",
"cls_token_id": 50281,
"decoder_bias": true,
"deterministic_flash_attn": false,
"embedding_dropout": 0.0,
"eos_token_id": 30001,
"global_attn_every_n_layers": 3,
"global_rope_theta": 160000.0,
"hidden_activation": "gelu",
"hidden_dropout_prob": 0.1,
"hidden_size": 512,
"initializer_cutoff_factor": 2.0,
"initializer_range": 0.02,
"intermediate_size": 2048,
"local_attention": 128,
"local_attention_rope_theta": 10000,
"local_attention_window": 128,
"local_rope_theta": 10000.0,
"max_position_embeddings": 8192,
"mlp_bias": false,
"mlp_dropout": 0.0,
"model_type": "modernbert",
"norm_bias": false,
"norm_eps": 1e-05,
"num_attention_heads": 8,
"num_hidden_layers": 6,
"pad_token_id": 1,
"repad_logits_with_grad": false,
"rope_theta": 160000,
"sep_token_id": 50282,
"sparse_pred_ignore_index": -100,
"sparse_prediction": false,
"torch_dtype": "float32",
"transformers_version": "4.53.1",
"type_vocab_size": 2,
"vocab_size": 30005
}
|