-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Downloading of sentence transformers #105
Comments
Which code are you testing with? |
I tested
Which allows to register config file. Then
Which gives me following error: |
Generally, It might be better to wait for #103.
For "BertModel", you would need to pass
|
It is now merged and released in v0.1.19, please give it a try. Let me know if there are any problems, feature requests, or any inconvenience when using that. |
Hi, Peter. I've tested downloading sentence transformers. Approach described above works fine with BERT-like sentence-transformers. In this approach I download and register config file and model:
Using macro doesn't work for sentence transformers, only for "token" transformers. Macro works only if I downloaded and register config file and model file. If I use macro without pre-download sentence-transformer:
I get:
In the case of using macro with adding 'sentence-transformers' prefix to model name:
|
You seems to be using the old version, please update to the latest one. And it should be used like this: using Transformers
using Transformers.Basic
using Transformers.HuggingFace
textenc = hgf"sentence-transformers/all-MiniLM-L6-v2:tokenizer"
model = hgf"sentence-transformers/all-MiniLM-L6-v2:model"
sentences = ["This is an example sentence", "Each sentence is converted"]
a = encode(textenc, sentences)
model_outputs = model(a.input.tok; token_type_ids = a.input.segment, attention_mask = a.mask) |
@chengchingwen, How could I load HuggingFace model from file stored locally? Is loading from HuggingFace portal and then saving it as .bson file the best way to do it? |
It really depends on the scenario. Would need to expand on that (e.g. what do you have and what do you want to achieve). |
Basic downloading doesn't work for sentence-transformers. Is it possible to download model using direct url or url for config.json?
The text was updated successfully, but these errors were encountered: