mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-05-02 20:04:37 +08:00
[Misc] improve gguf check (#15974)
Signed-off-by: reidliu41 <reid201711@gmail.com> Co-authored-by: reidliu41 <reid201711@gmail.com>
This commit is contained in:
parent
092475f738
commit
86cbd2eee9
@ -23,9 +23,14 @@ def check_gguf_file(model: Union[str, PathLike]) -> bool:
|
|||||||
elif model.suffix == ".gguf":
|
elif model.suffix == ".gguf":
|
||||||
return True
|
return True
|
||||||
|
|
||||||
with open(model, "rb") as f:
|
try:
|
||||||
header = f.read(4)
|
with model.open("rb") as f:
|
||||||
return header == b"GGUF"
|
header = f.read(4)
|
||||||
|
|
||||||
|
return header == b"GGUF"
|
||||||
|
except Exception as e:
|
||||||
|
logger.debug("Error reading file %s: %s", model, e)
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def modelscope_list_repo_files(
|
def modelscope_list_repo_files(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user