ebanalyse / NERDA

Framework for fine-tuning pretrained transformers for Named-Entity Recognition (NER) tasks
MIT License
153 stars 35 forks source link

not work with different pytorch/transformers version #13

Closed Hansyvea closed 3 years ago

Hansyvea commented 3 years ago

I tested the same dataset along with the same model and hyper parameters but in different versions of torch and transformers. It raises error with torch 1.81 as the following: TypeError: TextEncodeInput must be Union[TextInputSequence, Tuple[InputSequence, InputSequence]]

However, it works fine in the environment in which I just had NERDA pip installed...

smaakage85 commented 3 years ago

@Hansyvea thanks for feedback! You are absolutely correct. With so much happening on both 'transformers' and 'torch' at the moment it takes some work to keep 'NERDA' up to date! If you are able to fix the issue, I would really appreciate a Pull Request!

Dhruvit-Chaniyara commented 3 years ago

tokenizer = AutoTokenizer.from_pretrained("bert-base-cased", use_fast=False)

add parameter, "use_fast=false" in tokenizer

https://huggingface.co/transformers/migration.html

Hansyvea commented 3 years ago

tokenizer = AutoTokenizer.from_pretrained("bert-base-cased", use_fast=False)

add parameter, "use_fast=false" in tokenizer

https://huggingface.co/transformers/migration.html

thanks! it really solved the problem. do you know how to add other decoder layer such as CRF?

smaakage85 commented 3 years ago

thanks! I will fix this!

smaakage85 commented 3 years ago

Thanks for your input @Dhruvit-Chaniyara and @Hansyvea. I have fixed this in the new release.