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 6670f93 commit f518555Copy full SHA for f518555
gguf-py/gguf/gguf_reader.py
@@ -56,14 +56,14 @@ class ReaderField(NamedTuple):
56
57
def contents(self, index_or_slice: int | slice = slice(None)) -> Any:
58
if self.types:
59
- to_string = lambda x: str(x.tobytes(), encoding='utf-8')
+ to_string = lambda x: str(x.tobytes(), encoding='utf-8') # noqa: E731
60
main_type = self.types[0]
61
62
if main_type == GGUFValueType.ARRAY:
63
sub_type = self.types[-1]
64
65
if sub_type == GGUFValueType.STRING:
66
- indices = self.data[index_or_slice]
+ indices: int | list = self.data[index_or_slice]
67
68
if isinstance(index_or_slice, int):
69
return to_string(self.parts[indices])
0 commit comments