Closed CaiJichang212 closed 1 month ago
in yaml file, i set fp16: true
.
is this the cause of the bug?
Yes, enabling fp16: true in our local tests causes nan to appear
bf16 can solve this data overflow. KE/EasyEdit/easyeditor/editors/editor.py
if hasattr(hparams, 'fp16') and hparams.fp16:
torch_dtype = torch.float16
elif hasattr(hparams, 'bf16') and hparams.bf16:
torch_dtype = torch.bfloat16
else:
torch_dtype = torch.float32
Hint: torch > 2.0.1 i test with torch=2.3.0
Hi, do you have any further questions?
when run
run_knowedit_llama2.py
withLlama-2-7b
model &Wiki_recent
datasetbug:
other info, log: