offline mode
Hello, I want to use offline mode.
I have downloads files into '/home/data/sentence-transformers/all-mpnet-base-v2', I tried codes like this:hf = HuggingFaceEmbeddings(cache_folder='/home/data/sentence-transformers/all-mpnet-base-v2')
andhf = HuggingFaceEmbeddings(model_name='sentence-transformers/all-mpnet-base-v2', cache_folder='/home/data')
then these two lines codes raise same error:
Checkout your internet connection or see how to run the library in offline mode at 'https://huggingface.co/docs/transformers/installation#offline-mode'. ```
After that, I tried:
```hf = HuggingFaceEmbeddings('/home/data/sentence-transformers/all-mpnet-base-v2') ```,
then raise error:
``` HuggingFaceEmbeddings.__init__() takes 1 positional argument but 2 were given```
Then I tried codes:
```hf = HuggingFaceEmbeddings(model_name='/home/data/sentence-transformers/all-mpnet-base-v2') ```
then raise error: ```Repo id must be in the form 'repo_name' or 'namespace/repo_name': '/home/data/sentence-transformers/all-mpnet-base-v2'. Use `repo_type` argument if needed.```
How can I load model from my local directory `/home/data/sentence-transformers/all-mpnet-base-v2`?
i meet the same error. Have you solved it?
Hello!
Apologies, I missed this until now. You should be able to do:
embeddings = HuggingFaceEmbeddings('/home/data/sentence-transformers/all-mpnet-base-v2')
I.e., you can use the path to the directory with your local model.
- Tom Aarsen
Hello!
Apologies, I missed this until now. You should be able to do:
embeddings = HuggingFaceEmbeddings('/home/data/sentence-transformers/all-mpnet-base-v2')
I.e., you can use the path to the directory with your local model.
- Tom Aarsen
thanks , when i fixed my code as your instructions ,
i meet the error as following
Ahh, I see the API is slightly different than I thought. This should work:
embeddings = HuggingFaceEmbeddings(model_name='/home/data/sentence-transformers/all-mpnet-base-v2')