ImportError: cannot import name 'TFLongformerForMaskedLM'
I am trying to follow the example mentioned inLongformer.import tensorflow as tffrom transformers import LongformerTokenizer, TFLongformerForMaskedLMI get below error:ImportError                               Traceback (most recent call last)in1 import tensorflow as tf----> 2 from transformers import LongformerTokenizer, TFLongformerForMaskedLMImportError: cannot import name ‘TFLongformerForMaskedLM’How to resolve this? Pls let me know.Thanks,
2020-11-04T07:02:50Z
chandrak:from transformers import LongformerTokenizer, TFLongformerForMaskedLMMaybe you should check if you have the latest version of Huggingface Transformers. (i.e. 3.4.0)I can import it without any problem
2020-11-04T15:07:11Z
Thanks for replying.!pip freeze | grep transformerstransformers==3.4.0And, I still get the same errorimport tensorflow as tffrom transformers import LongformerTokenizer, TFLongformerForMaskedLMImportError                               Traceback (most recent call last)in1 import tensorflow as tf----> 2 from transformers import LongformerTokenizer, TFLongformerForMaskedLMImportError: cannot import name ‘TFLongformerForMaskedLM’
2020-11-04T23:11:19Z
I have no idea why you did get this import error.Maybe you can re-check with mydummy Colabin the 2nd cell with showing successfully creating the model.(The 3rd to last cells are not related to TFLongformer, please ignore)