gguf-py : cleaner way to get the first key (#20727)
This commit is contained in:
@@ -425,8 +425,7 @@ class GGUFWriter:
|
|||||||
fout = self.fout[file_id]
|
fout = self.fout[file_id]
|
||||||
|
|
||||||
# pop the first tensor info
|
# pop the first tensor info
|
||||||
# TODO: cleaner way to get the first key
|
first_tensor_name = next(iter(self.tensors[file_id]))
|
||||||
first_tensor_name = [name for name, _ in zip(self.tensors[file_id].keys(), range(1))][0]
|
|
||||||
ti = self.tensors[file_id].pop(first_tensor_name)
|
ti = self.tensors[file_id].pop(first_tensor_name)
|
||||||
assert ti.nbytes == tensor.nbytes
|
assert ti.nbytes == tensor.nbytes
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user