Skip to content

Commit

Permalink
convert-*.py: fix regression to write to same directory as dir_model
Browse files Browse the repository at this point in the history
  • Loading branch information
mofosyne committed Jun 3, 2024
1 parent 51953be commit 00ff73a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion convert-hf-to-gguf.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def __init__(self, dir_model: Path, ftype: gguf.LlamaFileType, fname_out: Path,
self.fname_out = fname_out.parent / gguf.fill_templated_filename(fname_out.name, output_type)
else:
# output in the same directory as the model by default
self.fname_out = dir_model.parent / self.fname_default
self.fname_out = dir_model / f"{self.fname_default}.gguf"

# Configure GGUF Writer
self.gguf_writer = gguf.GGUFWriter(self.fname_out, gguf.MODEL_ARCH_NAMES[self.model_arch], endianess=self.endianess, use_temp_file=self.use_temp_file)
Expand Down
1 change: 1 addition & 0 deletions gguf-py/gguf/gguf_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def __init__(
self, path: os.PathLike[str] | str, arch: str, use_temp_file: bool = True,
endianess: GGUFEndian = GGUFEndian.LITTLE,
):
logger.info(f"gguf: Will write to {path}")
self.fout = open(path, "wb")
self.arch = arch
self.endianess = endianess
Expand Down

0 comments on commit 00ff73a

Please sign in to comment.