Open abdoelsayed2016 opened 1 year ago
i have the same question
Is this inspection necessary? I feel that as long as we ensure that what we download is the weight of Huggingface, there should be no problem.
I am facing the same issue. Is there any solution to this? I downloaded the weights of llama-2-7b-hf from hugging face and wdiff-7b-alpaca from hf, and now the code exited with the afore mentioned error...
Same issue as above...
@woody8657, one possible solution that I came across while skimming through the code file weight_diff.py in github.com/tatsu-lab/stanford_alpaca is to toggle the boolean value of check_integrity_naively
, at line 77 to False
. In this way the below check starting at line 127
if check_integrity_naively:
# This is not a rigorous, cryptographically strong integrity check :)
allsum = sum(state_dict_recovered[key].sum() for key in state_dict_recovered)
assert torch.allclose(
allsum, torch.full_like(allsum, fill_value=50637.1836), atol=1e-2, rtol=0
), "Naive integrity check failed. This could imply that some of the checkpoint files are corrupted."
does not execute and restoration of weights goes successful
Same problem
@woody8657, one possible solution that I came across while skimming through the code file weight_diff.py in github.com/tatsu-lab/stanford_alpaca is to toggle the boolean value of
check_integrity_naively
, at line 77 toFalse
. In this way the below check starting at line 127if check_integrity_naively: # This is not a rigorous, cryptographically strong integrity check :) allsum = sum(state_dict_recovered[key].sum() for key in state_dict_recovered) assert torch.allclose( allsum, torch.full_like(allsum, fill_value=50637.1836), atol=1e-2, rtol=0 ), "Naive integrity check failed. This could imply that some of the checkpoint files are corrupted."
does not execute and restoration of weights goes successful
I bypass the integrity check without modifying the source code by using the CLI argument --nocheck_integrity_naively
. Simply run the command as follows: python weight_diff.py recover --nocheck_integrity_naively --path_raw <path_to_step_1_dir> --path_diff <path_to_step_2_dir> --path_tuned <path_to_store_recovered_weights>
Thank you so much, @Ki-Seki . Your solution works!!
python weight_diff.py recover --path_raw './PR_7B' --path_diff './output' --path_tuned './recover'