OverflowError: out of range integral type conversion attempted
I get the following error:
You're using a T5TokenizerFast tokenizer. Please note that with a fast tokenizer, using the __call__ method is faster than using a method to encode the text followed by a call to the pad method to get a padded encoding.
100% 1061/1061 [2:04:03<00:00, 3.45s/it]Traceback (most recent call last):
File "/content/mm-cot/main.py", line 395, in
when I run the inference for rationale generation
CUDA_VISIBLE_DEVICES=0,1,2,3 python main.py \
--data_root data/ScienceQA/data \
--caption_file data/instruct_captions.json \
--model declare-lab/flan-alpaca-large \
--user_msg rationale --img_type vit \
--bs 2 --eval_bs 4 --epoch 50 --lr 5e-5 --output_len 512 \
--use_caption --use_generate --prompt_format QCM-E \
--output_dir experiments \
--evaluate_dir models/mm-cot-large-rationale
This happens after those 1061 iterations are completed. As a consequence it doesn't generate experiments/rationale_declare-lab-flan-alpaca-large_vit_QCM-E_lr5e-05_bs8_op512_ep50/predictions_ans_eval.json which is expected by answer inference phase for inference
I have the same problem.
I suspect it's an error caused by the tokenizer not being able to decode it, as preds contain a value of -100, It is related to this issue (https://github.com/huggingface/transformers/issues/22634)
I tried https://github.com/huggingface/transformers/issues/24433#issuecomment-1764248213 and it seems to have worked
This issue may be due to the update of the transformers library. The solution above seems to be effective.