README / README.md
espejelomar's picture
Update README.md
284ec80
|
raw
history blame
4.96 kB
metadata
title: README
emoji: ❤️
colorFrom: red
colorTo: red
sdk: static
pinned: false

Install the Sentence Transformers library.

    pip install -U sentence-transformers
        

The usage is as simple as:

from sentence_transformers import SentenceTransformer
model = SentenceTransformer('paraphrase-MiniLM-L6-v2')

#Our sentences we like to encode sentences = ['This framework generates embeddings for each input sentence', 'Sentences are passed as a list of string.', 'The quick brown fox jumps over the lazy dog.']

#Sentences are encoded by calling model.encode() embeddings = model.encode(sentences)

#Print the embeddings for sentence, embedding in zip(sentences, embeddings): print("Sentence:", sentence) print("Embedding:", embedding) print("")

Hugging Face makes it easy to collaboratively build and showcase your Sentence Transformers models! You can collaborate with your organization, upload and showcase your own models in your profile ❤️

Documentation
Push your Sentence Transformers models to the Hub ❤️
Find all Sentence Transformers models on the 🤗 Hub

To upload your Sentence Transformers models to the 🤗 Hub use the save_to_hub function within the Sentence Transformers library.

    !pip install -U sentence-transformers
    !huggingface-cli login
    from sentence_transformers import save_to_hub
    save_to_hub(repo_name = 'cool_new_model')
        

To load Sentence Transformers models from the 🤗 Hub use the SentenceTransformer class.

    !pip install -U sentence-transformers
    from sentence_transformers import SentenceTransformer
    model = SentenceTransformer("your-username/your-awesome-model")