Skip to content

Commit 59f5a27

Browse files
committed
gguf-py : flake8 fixes
1 parent 6f8d280 commit 59f5a27

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

convert-hf-to-gguf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class Model:
6565
model_arch: gguf.MODEL_ARCH
6666

6767
def __init__(self, dir_model: Path, ftype: int, fname_out: Path, is_big_endian: bool, use_temp_file: bool, eager: bool):
68-
if type(self) == Model:
68+
if type(self) is Model:
6969
raise TypeError(f"{type(self).__name__!r} should not be directly instantiated")
7070
self.dir_model = dir_model
7171
self.ftype = ftype

gguf-py/gguf/lazy.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
from abc import ABC, ABCMeta, abstractmethod
33

44
import logging
5-
from typing import Any, Callable, Iterable, SupportsIndex
5+
from typing import Any, Callable
66
from collections import deque
77

88
import numpy as np
9-
from numpy.typing import DTypeLike, NDArray
10-
from numpy._typing import _ShapeLike
9+
from numpy.typing import DTypeLike
1110

1211

1312
logger = logging.getLogger(__name__)
@@ -132,7 +131,7 @@ def wrapped_fn(*args, **kwargs):
132131
assert isinstance(res, cls)
133132
res = res._meta
134133
# allow operations to override the dtype
135-
if meta_noop != True:
134+
if meta_noop is not True:
136135
res = cls.meta_with_dtype(res, meta_noop)
137136

138137
if isinstance(res, cls._tensor_type):
@@ -193,7 +192,7 @@ def meta_with_dtype(cls, m: Any, dtype: Any) -> Any: pass
193192

194193
@classmethod
195194
def from_eager(cls, t: Any) -> Any:
196-
if type(t) == cls:
195+
if type(t) is cls:
197196
# already eager
198197
return t
199198
elif isinstance(t, cls._tensor_type):

0 commit comments

Comments
 (0)