We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 619d0f8 commit 29f76e2Copy full SHA for 29f76e2
vllm/transformers_utils/utils.py
@@ -20,18 +20,16 @@ def check_gguf_file(model: Union[str, PathLike]) -> bool:
20
model = Path(model)
21
if not model.is_file():
22
return False
23
-
24
- import struct
25
26
- from gguf.constants import GGUF_MAGIC
+ elif model.suffix == ".gguf":
+ return True
27
28
try:
29
with model.open("rb") as f:
30
- first_4_bytes = f.read(4)
31
- if len(first_4_bytes) < 4:
+ header = f.read(4)
+ if len(header) < 4:
32
33
34
- return struct.unpack("<I", first_4_bytes)[0] == GGUF_MAGIC
+ return header == b"GGUF"
35
except Exception as e:
36
logger.debug("Error reading file %s: %s", model, e)
37
0 commit comments