forked from EngineX-Cambricon/enginex-mlu370-vllm
add qwen3
This commit is contained in:
16
vllm-v0.6.2/vllm/transformers_utils/utils.py
Normal file
16
vllm-v0.6.2/vllm/transformers_utils/utils.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from os import PathLike
|
||||
from pathlib import Path
|
||||
from typing import Union
|
||||
|
||||
|
||||
def check_gguf_file(model: Union[str, PathLike]) -> bool:
|
||||
"""Check if the file is a GGUF model."""
|
||||
model = Path(model)
|
||||
if not model.is_file():
|
||||
return False
|
||||
elif model.suffix == ".gguf":
|
||||
return True
|
||||
|
||||
with open(model, "rb") as f:
|
||||
header = f.read(4)
|
||||
return header == b"GGUF"
|
||||
Reference in New Issue
Block a user