UKPLab / sentence-transformers

State-of-the-Art Text Embeddings
https://www.sbert.net
Apache License 2.0
15.41k stars 2.49k forks source link

model path setting #639

Open johnbager opened 3 years ago

johnbager commented 3 years ago

just like from sentence_transformers import SentenceTransformer, util model = SentenceTransformer('distilbert-base-nli-stsb-mean-tokens')

could you tell me if i download you pretrained model "distilbert-base-nli-stsb-mean-tokens",and unzip, how can i change "model = SentenceTransformer('distilbert-base-nli-stsb-mean-tokens')" to setting my path.

nreimers commented 3 years ago

After downloading and unzipping, you can load it like this:

model = SentenceTransformer('/path/to/unzipped/folder/')