Hugging Face's logo Hugging Face
  • Models
  • Datasets
  • Spaces
  • Buckets new
  • Docs
  • Enterprise
  • Pricing

  • Log In
  • Sign Up

davanstrien
/
code-prompt-similarity-model

Sentence Similarity
sentence-transformers
Safetensors
English
mpnet
feature-extraction
dataset_size:n<1K
loss:MultipleNegativesRankingLoss
Eval Results (legacy)
text-embeddings-inference
Model card Files Files and versions
xet
Community

Instructions to use davanstrien/code-prompt-similarity-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.

  • Libraries
  • sentence-transformers

    How to use davanstrien/code-prompt-similarity-model with sentence-transformers:

    from sentence_transformers import SentenceTransformer
    
    model = SentenceTransformer("davanstrien/code-prompt-similarity-model")
    
    sentences = [
        "Write a Python function that counts the number of even numbers in a given list of integers or floats",
        "Write a Python function that returns the number of even numbers in a list.",
        "Create a Python function that adds up all the numbers in a given list. The function should support lists containing only positive integers.",
        "Write a Python function that converts a JSON string into a Python dictionary using the json module and returns it."
    ]
    embeddings = model.encode(sentences)
    
    similarities = model.similarity(embeddings, embeddings)
    print(similarities.shape)
    # [4, 4]
  • Notebooks
  • Google Colab
  • Kaggle
code-prompt-similarity-model
439 MB
Ctrl+K
Ctrl+K
  • 1 contributor
History: 3 commits
davanstrien's picture
davanstrien HF Staff
Update README.md
5378261 verified almost 2 years ago
  • 1_Pooling
    Add new SentenceTransformer model. almost 2 years ago
  • .gitattributes
    1.52 kB
    initial commit almost 2 years ago
  • README.md
    15.3 kB
    Update README.md almost 2 years ago
  • config.json
    594 Bytes
    Add new SentenceTransformer model. almost 2 years ago
  • config_sentence_transformers.json
    201 Bytes
    Add new SentenceTransformer model. almost 2 years ago
  • model.safetensors
    438 MB
    xet
    Add new SentenceTransformer model. almost 2 years ago
  • modules.json
    229 Bytes
    Add new SentenceTransformer model. almost 2 years ago
  • sentence_bert_config.json
    53 Bytes
    Add new SentenceTransformer model. almost 2 years ago
  • special_tokens_map.json
    962 Bytes
    Add new SentenceTransformer model. almost 2 years ago
  • tokenizer.json
    711 kB
    Add new SentenceTransformer model. almost 2 years ago
  • tokenizer_config.json
    1.39 kB
    Add new SentenceTransformer model. almost 2 years ago
  • vocab.txt
    232 kB
    Add new SentenceTransformer model. almost 2 years ago