From ff5d21e608f10a72f8af34591b59e1c9fd24f5c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sigbj=C3=B8rn=20Skj=C3=A6ret?= Date: Sun, 21 Apr 2024 11:43:43 +0200 Subject: [PATCH] switch to namedtuple, no need to dataclass --- gguf-py/scripts/gguf-new-metadata.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/gguf-py/scripts/gguf-new-metadata.py b/gguf-py/scripts/gguf-new-metadata.py index 3963d13dd..9a0cec64a 100755 --- a/gguf-py/scripts/gguf-new-metadata.py +++ b/gguf-py/scripts/gguf-new-metadata.py @@ -7,8 +7,7 @@ import json from pathlib import Path import numpy as np -from typing import Any, Mapping, Sequence -from dataclasses import dataclass +from typing import Any, Mapping, Sequence, NamedTuple # Necessary to load the local gguf package if "NO_LOCAL_GGUF" not in os.environ and (Path(__file__).parent.parent.parent / 'gguf-py').exists(): @@ -19,8 +18,7 @@ import gguf logger = logging.getLogger("gguf-new-metadata") -@dataclass -class MetadataDetails: +class MetadataDetails(NamedTuple): type: gguf.GGUFValueType value: Any description: str = ''