Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing
    • Website
      • Tasks
      • HuggingChat
      • Collections
      • Languages
      • Organizations
    • Community
      • Blog
      • Posts
      • Daily Papers
      • Hardware
      • Learn
      • Discord
      • Forum
      • GitHub
    • Solutions
      • Team & Enterprise
      • Hugging Face PRO
      • Enterprise Support
      • Inference Providers
      • Inference Endpoints
      • Storage Buckets

  • Log In
  • Sign Up

benjamintli
/
modernbert-code

Sentence Similarity
sentence-transformers
Safetensors
modernbert
feature-extraction
dense
Generated from Trainer
dataset_size:193623
loss:CachedMultipleNegativesRankingLoss
Eval Results (legacy)
text-embeddings-inference
Model card Files Files and versions
xet
Community

Instructions to use benjamintli/modernbert-code with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • sentence-transformers

    How to use benjamintli/modernbert-code with sentence-transformers:

    from sentence_transformers import SentenceTransformer
    
    model = SentenceTransformer("benjamintli/modernbert-code")
    
    sentences = [
        "@Override\n    public void encode(final OtpOutputStream buf) {\n        final int arity = elems.length;\n\n        buf.write_tuple_head(arity);\n\n        for (int i = 0; i < arity; i++) {\n            buf.write_any(elems[i]);\n        }\n    }",
        "fetch function with the same interface than in cozy-client-js",
        "Convert this tuple to the equivalent Erlang external representation.\n\n@param buf\nan output stream to which the encoded tuple should be written.",
        "Delete a customer by it's id.\n\n@param int $id The id\n\n@return bool\n@throws \\Throwable in case something went wrong when deleting."
    ]
    embeddings = model.encode(sentences)
    
    similarities = model.similarity(embeddings, embeddings)
    print(similarities.shape)
    # [4, 4]
  • Notebooks
  • Google Colab
  • Kaggle
modernbert-code
600 MB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 21 commits
benjamintli's picture
benjamintli
End of training
335bb1d verified 4 months ago
  • 1_Pooling
    End of training 4 months ago
  • eval
    Training in progress, step 190 4 months ago
  • .gitattributes
    1.52 kB
    initial commit 4 months ago
  • README.md
    36.1 kB
    End of training 4 months ago
  • config.json
    1.9 kB
    Training in progress, step 10 4 months ago
  • config_sentence_transformers.json
    283 Bytes
    End of training 4 months ago
  • model.safetensors
    596 MB
    xet
    Training in progress, step 190 4 months ago
  • modules.json
    229 Bytes
    End of training 4 months ago
  • sentence_bert_config.json
    58 Bytes
    End of training 4 months ago
  • tokenizer.json
    3.58 MB
    Training in progress, step 10 4 months ago
  • tokenizer_config.json
    351 Bytes
    Training in progress, step 10 4 months ago
  • training_args.bin
    5.59 kB
    xet
    Training in progress, step 10 4 months ago