You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I was following TRANSFORMER_EMBEDDINGS.md tutorial and tried assigning a batch_size for multiple sentences inference at once, and I got an error saying that batch_size is an unexpected keyword argument.
In the Arguments Section it says that I can use batch_size, but I was unable to.
It seems in Flair==0.7 works
To Reproduce
from flair.embeddings import TransformerWordEmbeddings
model = TransformerWordEmbeddings('bert-base-uncased', batch_size=2)
Traceback:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/unai/miniconda3/envs/li_encoding/lib/python3.7/site-packages/flair/embeddings/token.py", line 821, in __init__
self.model = AutoModel.from_pretrained(model, config=config, **kwargs)
File "/home/unai/miniconda3/envs/li_encoding/lib/python3.7/site-packages/transformers/models/auto/modeling_auto.py", line 815, in from_pretrained
pretrained_model_name_or_path, *model_args, config=config, **kwargs
File "/home/unai/miniconda3/envs/li_encoding/lib/python3.7/site-packages/transformers/modeling_utils.py", line 1058, in from_pretrained
model = cls(config, *model_args, **model_kwargs)
TypeError: __init__() got an unexpected keyword argument 'batch_size'
Expected behavior
I would expect a normal initialization of model, and then being able to embed sentences in chunks
Environment:
OS: Linux (Ubuntu 18.04.5 LTS)
Flair Version: 0.8
The text was updated successfully, but these errors were encountered:
Describe the bug
I was following TRANSFORMER_EMBEDDINGS.md tutorial and tried assigning a
batch_size
for multiple sentences inference at once, and I got an error saying that batch_size is an unexpected keyword argument.In the Arguments Section it says that I can use
batch_size
, but I was unable to.It seems in Flair==0.7 works
To Reproduce
Traceback:
Expected behavior
I would expect a normal initialization of model, and then being able to embed sentences in chunks
Environment:
The text was updated successfully, but these errors were encountered: