Closed tschomacker closed 2 years ago
Hi, the shape should be ([1, 1024, 1,1]). I cannot reproduce this, could you send me a minimal sample of your data/script that produces this error? and just to make sure, the transformers version you have installed, is it the one linked in the requirements file (not the default huggingface code, we had make some changes to mbart).
Hi, thanks for the very quick response. I have actually changed the requirements and installed the 'normal' transformers package. I changed it because running the conversion (same call as aboce) with transformers @ git+https://github.com/ZurichNLP/transformers.git@longmbart#egg=transformers
installed, resulted in:
Traceback (most recent call last):
File "/home/jovyan/git/longmbart/./scripts/convert_mbart_to_longformerencoderdecoder.py", line 11, in <module>
from transformers import MBartForConditionalGeneration
File "/opt/conda/lib/python3.9/site-packages/transformers/__init__.py", line 2162, in __getattr__
return super().__getattr__(name)
File "/opt/conda/lib/python3.9/site-packages/transformers/file_utils.py", line 1479, in __getattr__
value = getattr(module, name)
File "/opt/conda/lib/python3.9/site-packages/transformers/file_utils.py", line 1478, in __getattr__
module = self._get_module(self._class_to_module[name])
File "/opt/conda/lib/python3.9/site-packages/transformers/models/mbart/__init__.py", line 89, in _get_module
return importlib.import_module("." + module_name, self.__name__)
File "/opt/conda/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/opt/conda/lib/python3.9/site-packages/transformers/models/mbart/modeling_mbart.py", line 47, in <module>
from longformer.longformer_encoder_decoder import LongformerSelfAttentionForBart
ModuleNotFoundError: No module named 'longformer'
This issues was resolved after switching to 'normal' transformers.
ok, longmbart will not run with the standard transformer library, because longmbart uses attention masks with 3 values (0,1,2) instead of the standard (0,1) - this is to distinguish local and global attention. You need the transformers repo linked in requirements.
The conversion error looks like your longmbart repo wasn't installed in your python environment, you can do this with (from within the longmbart directory):
pip install -e .
I am trying to fine-tune my own longmbart on text simplification. But I am little stucked. Conversion worked but I got an Error when starting to fine-tune. I would really appreciate any hints on how to fix the problem.
What I did previously:
pip install -q -r requirements.txt
This threw the following RuntimeError:
Current Bevior: RuntimeError
I have checked
float_mask
and its size:torch.Size([1, 1, 1024, 1024, 1, 1])
. Which looks odd to me