Instructions to use hku-nlp/instructor-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use hku-nlp/instructor-base with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("hku-nlp/instructor-base") sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Transformers
How to use hku-nlp/instructor-base with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("hku-nlp/instructor-base") model = AutoModel.from_pretrained("hku-nlp/instructor-base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download pytorch_model.bin from hku-nlp/instructor-base: direct link, hf CLI and curl.
- Browser
- Download file 439 MB
-
https://huggingface.co/hku-nlp/instructor-base/resolve/main/pytorch_model.bin
- Command line
-
hf download hf://hku-nlp/instructor-base/pytorch_model.bin
-
curl -L -o pytorch_model.bin https://huggingface.co/hku-nlp/instructor-base/resolve/main/pytorch_model.bin
439 MB
- Xet hash:
- c526a2435ea3f0b66071868618af1dbf4a316c2b1dee91f56b411ee05e88fab6
- Size of remote file:
- 439 MB
- SHA256:
- 5ee57a1fca2d2d2fad7dd837e17d65b66bb86198d2f89b514982d0cf7c30fa80
·
Xet efficiently stores Large Files inside Git, intelligently splitting files into unique chunks and accelerating uploads and downloads. More info.