Skip to content

Commit 695fbaf

Browse files
author
katsu560
committed
remove debug code, unused code
1 parent e8720f6 commit 695fbaf

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

examples/yolo/gguf-addfile.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import os
99
import sys
1010
from pathlib import Path
11-
#from typing import Any
12-
from typing import Any, Literal, NamedTuple, TypeVar, Union
11+
from typing import Any
12+
#from typing import Any, Literal, NamedTuple, TypeVar, Union
1313

1414
import numpy as np
1515
import numpy.typing as npt
@@ -111,15 +111,6 @@ def copy_with_filename(reader: gguf.GGUFReader, writer: gguf.GGUFWriter, new_met
111111
shape = np.flipud(tensor.shape)
112112
writer.add_tensor_info(tensor.name, shape, tensor.data.dtype, tensor.data.nbytes, tensor.tensor_type)
113113

114-
offset_next = 0
115-
len_last = 0
116-
offset_last = 0
117-
for n, tensor in enumerate(reader.tensors, 1):
118-
len_last = tensor.n_bytes
119-
offset_last = tensor.data_offset
120-
offset_next = max(offset_next, writer.ggml_pad(offset_last + int(len_last), writer.data_alignment))
121-
122-
offs = offset_next
123114
# add file info as tensor_info
124115
for path in filename:
125116
logger.debug(f'Adding {path}')
@@ -177,7 +168,6 @@ def main() -> None:
177168
for path in args.addfiles:
178169
filename.append(path)
179170
logger.info(f'* Adding: {path}')
180-
#new_metadata[Keys.EMBEDDED_FILES] = path
181171
copy_with_filename(reader, writer, new_metadata, filename)
182172

183173

0 commit comments

Comments
 (0)