Skip to content

Commit c4e6f6f

Browse files
authored
flake--
1 parent 8d36967 commit c4e6f6f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

gguf-py/scripts/gguf-new-metadata.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class MetadataDetails:
2525
value: Any
2626
description: str = ''
2727

28+
2829
def get_byteorder(reader: gguf.GGUFReader) -> gguf.GGUFEndian:
2930
if np.uint32(1) == np.uint32(1).newbyteorder("<"):
3031
# Host is little endian
@@ -67,12 +68,12 @@ def get_field_data(reader: gguf.GGUFReader, key: str) -> Any:
6768

6869

6970
def find_token(token_list: Sequence[int], token: str) -> Sequence[int]:
70-
token_ids = [index for index, value in enumerate(token_list) if value == token]
71+
token_ids = [index for index, value in enumerate(token_list) if value == token]
7172

72-
if len(token_ids) == 0:
73-
raise LookupError(f'Unable to find "{token}" in token list!')
73+
if len(token_ids) == 0:
74+
raise LookupError(f'Unable to find "{token}" in token list!')
7475

75-
return token_ids
76+
return token_ids
7677

7778

7879
def copy_with_new_metadata(reader: gguf.GGUFReader, writer: gguf.GGUFWriter, new_metadata: Mapping[str, MetadataDetails], remove_metadata: Sequence[str]) -> None:

0 commit comments

Comments
 (0)