Skip to content

Commit e90e0c7

Browse files
authored
second attempt
1 parent f518555 commit e90e0c7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

gguf-py/gguf/gguf_reader.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,14 @@ def contents(self, index_or_slice: int | slice = slice(None)) -> Any:
6363
sub_type = self.types[-1]
6464

6565
if sub_type == GGUFValueType.STRING:
66-
indices: int | list = self.data[index_or_slice]
66+
indices: int | list[int] = self.data[index_or_slice]
6767

6868
if isinstance(index_or_slice, int):
69-
return to_string(self.parts[indices])
69+
idx: int = indices
70+
return to_string(self.parts[idx])
7071
else:
71-
return [to_string(self.parts[idx]) for idx in indices]
72+
idxlist: list[int] = indices
73+
return [to_string(self.parts[idx]) for idx in idxlist]
7274
else:
7375
# FIXME: When/if _get_field_parts() support multi-dimensional arrays, this must do so too
7476

0 commit comments

Comments
 (0)