fix test case

Former-commit-id: c244af0dc3478532de02271667e7af4ad8f54228
This commit is contained in:
hiyouga 2024-06-25 02:51:49 +08:00
parent 0ae1302e41
commit 80effa2993

View File

@ -73,7 +73,8 @@ def test_valuehead():
tokenizer_module["tokenizer"], model_args, finetuning_args, is_trainable=False, add_valuehead=True
)
ref_model = AutoModelForCausalLMWithValueHead.from_pretrained(
ref_model: "AutoModelForCausalLMWithValueHead" = AutoModelForCausalLMWithValueHead.from_pretrained(
TINY_LLAMA_VALUEHEAD, torch_dtype=torch.float16, device_map=get_current_device()
)
ref_model.v_head = ref_model.v_head.to(torch.float16)
compare_model(model, ref_model)