Notifications
Clear all
BugOverflow
1
Posty
2
Users
0
Reactions
1,705
Widok
0
18/06/2023 9:44 pm
Topic starter
how to fix this error
Exception has occurred: RuntimeError CUDA error: device-side assert triggered CUDA kernel errors might be asynchronously reported at some other API call, so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1. Compile with `TORCH_USE_CUDA_DSA` to enable device-side assertions. File "/mnt/k/MajorbotData/TraningCommentsModelPara/gpt2.py", line 89, in training_step loss = self(input_ids, attention_mask, labels) File "/mnt/k/MajorbotData/TraningCommentsModelPara/gpt2.py", line 73, in forward outputs = self.model(input_ids, attention_mask=attention_mask, labels=labels) RuntimeError: CUDA error: device-side assert triggered
1 Answer
0
18/06/2023 9:45 pm
Topic starter
In my case that was just changing special token from
tokenizer.add_special_tokens({'pad_token': '[PAD]'})
to
tokenizer.pad_token = tokenizer.eos_token