Skip to content

Commit f45ef6c

Browse files
committed
constant.py: logger.error then exit should be a raise exception instead
1 parent c37cafe commit f45ef6c

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

gguf-py/gguf/constants.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import annotations
22

33
import logging
4-
import sys
54
from enum import Enum, IntEnum, auto
65
from typing import Any
76

@@ -840,8 +839,7 @@ def get_type(val: Any) -> GGUFValueType:
840839
return GGUFValueType.INT32
841840
# TODO: need help with 64-bit types in Python
842841
else:
843-
logger.error(f"Unknown type: {type(val)}")
844-
sys.exit()
842+
raise ValueError(f"Unknown type: {type(val)}")
845843

846844

847845
# Note: Does not support GGML_QKK_64

0 commit comments

Comments
 (0)