tidy up
This commit is contained in:
parent
69d6e7a8e9
commit
0779f2f74f
2 changed files with 9 additions and 7 deletions
|
@ -2891,13 +2891,14 @@ def main() -> None:
|
|||
model_instance.gguf_writer.add_quantization_version(gguf.GGML_QUANT_VERSION)
|
||||
|
||||
if args.vocab_only:
|
||||
logger.info(f"Exporting model vocab to '{model_instance.fname_out}'")
|
||||
logger.info(f"Exporting model vocab...")
|
||||
model_instance.write_vocab()
|
||||
logger.info(f"Model vocab successfully exported.")
|
||||
else:
|
||||
logger.info(f"Exporting model to '{model_instance.fname_out}'")
|
||||
logger.info(f"Exporting model...")
|
||||
model_instance.write()
|
||||
logger.info(f"Model successfully exported.")
|
||||
|
||||
logger.info(f"Model successfully exported to '{model_instance.fname_out}'")
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
@ -95,7 +95,7 @@ class GGUFWriter:
|
|||
fout: list[BufferedWriter | None] | None
|
||||
path: os.PathLike[str] | str | None
|
||||
temp_file: tempfile.SpooledTemporaryFile[bytes] | None
|
||||
tensors: list[dict[str, TensorInfo]]
|
||||
tensors: list[dict[str, TensorInfo | np.ndarray[Any, Any]]]
|
||||
kv_data: list[dict[str, GGUFValue]]
|
||||
state: WriterState
|
||||
_simple_value_packing = {
|
||||
|
@ -327,7 +327,8 @@ class GGUFWriter:
|
|||
if self.state is not WriterState.NO_FILE:
|
||||
raise ValueError(f'Expected output file to be not yet opened, got {self.state}')
|
||||
|
||||
if name in self.tensors:
|
||||
for i in range(len(self.tensors)):
|
||||
if name in self.tensors[i]:
|
||||
raise ValueError(f'Duplicated tensor name {name!r}')
|
||||
|
||||
if raw_dtype is None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue