fix gguf_writer placement and remove comments
This commit is contained in:
parent
a9c7703c12
commit
efead0408c
2 changed files with 2 additions and 12 deletions
|
@ -56,11 +56,11 @@ class Model:
|
|||
part_names: list[str]
|
||||
is_safetensors: bool
|
||||
hparams: dict[str, Any]
|
||||
gguf_writer: gguf.GGUFManager
|
||||
block_count: int
|
||||
tensor_map: gguf.TensorNameMap
|
||||
tensor_names: set[str] | None
|
||||
fname_out: Path
|
||||
gguf_writer: gguf.GGUFManager
|
||||
|
||||
# subclasses should define this!
|
||||
model_arch: gguf.MODEL_ARCH
|
||||
|
|
|
@ -305,20 +305,10 @@ class GGUFManager:
|
|||
tensor.byteswap(inplace=True)
|
||||
|
||||
# TODO reimplement temp file
|
||||
#if self.use_temp_file and self.temp_file is None:
|
||||
# fp = tempfile.SpooledTemporaryFile(mode="w+b", max_size=256 * 1024 * 1024)
|
||||
# fp.seek(0)
|
||||
# self.temp_file = fp
|
||||
# I'm pretty sure it gets handled per shard?
|
||||
|
||||
self.tensors.append((name, tensor, raw_dtype))
|
||||
|
||||
#if self.temp_file is None:
|
||||
# self.tensors.append(tensor)
|
||||
# return
|
||||
|
||||
#tensor.tofile(self.temp_file)
|
||||
#self.write_padding(self.temp_file, tensor.nbytes)
|
||||
|
||||
def close(self) -> None:
|
||||
for _, _, writer in self.split_strategy:
|
||||
writer.close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue