RuntimeError: The size of tensor a must match the size of tensor b #7530
-
Hi. I trained a ["transformer", "ner"] pipeline by fine-tuning biobert-base-cased-v1.1 on my domain-specific corpus. At prediction time, and only on one of my 4 evaluation corpora, I get the following error :
Any idea of what is going wrong ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
My best guess is that one of the evaluation corpora has longer texts than the others, but the details would depend on your You probably need to add a You can probably achieve this by adding {"model_max_length": 512} |
Beta Was this translation helpful? Give feedback.
My best guess is that one of the evaluation corpora has longer texts than the others, but the details would depend on your
span_getters
setting.You probably need to add a
model_max_length
to your transformer model as described here: #7393 (comment)You can probably achieve this by adding
tokenizer_config.json
with the right settings to the savedtransformers/model
directory without retraining. I haven't tested this, but it will probably look something like this: