update pre-commit config (#18860)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
# Adapted from https://github.com/vllm-project/vllm/blob/v0.6.4.post1/vllm/model_executor/model_loader/weight_utils.py
|
||||
|
||||
"""Utilities for downloading and initializing model weights."""
|
||||
|
||||
import collections
|
||||
import concurrent.futures
|
||||
import fnmatch
|
||||
@@ -140,12 +141,10 @@ def convert_bin_to_safetensor_file(
|
||||
sf_size = os.stat(sf_filename).st_size
|
||||
pt_size = os.stat(pt_filename).st_size
|
||||
if (sf_size - pt_size) / pt_size > 0.01:
|
||||
raise RuntimeError(
|
||||
f"""The file size different is more than 1%:
|
||||
raise RuntimeError(f"""The file size different is more than 1%:
|
||||
- {sf_filename}: {sf_size}
|
||||
- {pt_filename}: {pt_size}
|
||||
"""
|
||||
)
|
||||
""")
|
||||
|
||||
# check if the tensors are the same
|
||||
reloaded = safetensors.torch.load_file(sf_filename)
|
||||
|
||||
Reference in New Issue
Block a user