neulab / awesome-align

A neural word aligner based on multilingual BERT
https://arxiv.org/abs/2101.08231
BSD 3-Clause "New" or "Revised" License
325 stars 47 forks source link

problem with mask_token #32

Closed v-zixin closed 2 years ago

v-zixin commented 2 years ago

I'm trying to fine-tune on parallel data, and I get an error in the mask_token function in run_train.py

The error message is: Mask tensor can only take 0 and 1 values. (Line 146).

Could you offer some advice on how to fix this?

zdou0830 commented 2 years ago

Hi, what's your pytorch and python version?

zixinzeng-jennifer commented 2 years ago

Thanks for the quick reply. I'm using Python 3.8.6, torch 1.9.0+cpu

zdou0830 commented 2 years ago

Hi, it seems that I cannot reproduce this error on my end. Could you print out the detailed error message?

Also, could you see if changing this line (https://github.com/neulab/awesome-align/blob/master/awesome_align/run_train.py#L154) to mask_type = torch.bool and running python setup.py install again would solve the issue?