--- title: README emoji: ❤️ colorFrom: red colorTo: red sdk: static pinned: false --- SentenceTransformers 🤗 is a Python framework for state-of-the-art sentence, text and image embeddings. Install the [Sentence Transformers](https://www.sbert.net/) library. ``` pip install -U sentence-transformers ``` The usage is as simple as: ```python from sentence_transformers import SentenceTransformer model = SentenceTransformer('paraphrase-MiniLM-L6-v2') # Sentences we want to encode. Example: sentence = ['This framework generates embeddings for each input sentence'] # Sentences are encoded by calling model.encode() embedding = model.encode(sentence) ``` Hugging Face makes it easy to collaboratively build and showcase your [Sentence Transformers](https://www.sbert.net/) 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 Hugging Face Hub, log in with `huggingface-cli login` and use the [`save_to_hub`](https://sbert.net/docs/package_reference/SentenceTransformer.html#sentence_transformers.SentenceTransformer.save_to_hub) method within the Sentence Transformers library. ```python from sentence_transformers import SentenceTransformer # Load or train a model model = SentenceTransformer(...) # Push to Hub model.save_to_hub("my_new_model") ```