-
Notifications
You must be signed in to change notification settings - Fork 9.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
convert-hf : print output file name when completed #8181
convert-hf : print output file name when completed #8181
Conversation
This commit adds the output file name to the log message when the conversion is completed. The motivation for this change is that when `--outfile` option is not specified it migth not be obvious where the output file is written. With this change the output of running the script will be something like the following: ```console INFO:hf-to-gguf:Model successfully exported to models/gemma-2-9b-it.gguf. ``` Signed-off-by: Daniel Bevenius <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is nice, although since #6942, the output file names are already printed before the progress bar.
On master
, after printing the tensors, their types and their shape, there's this:
INFO:gguf.gguf_writer:Writing the following files:
INFO:gguf.gguf_writer:/srv/LLMstash/tmp/bf16-tests/tinymistral-bf16.gguf: n_tensors = 111, total_size = 496.1M
Writing: 100%|█████████████████████████████████████████████████████████████████████████████████| 496M/496M [00:05<00:00, 94.4Mbyte/s]
INFO:hf-to-gguf:Model successfully exported.
Your proposal would change this into
INFO:gguf.gguf_writer:Writing the following files:
INFO:gguf.gguf_writer:/srv/LLMstash/tmp/bf16-tests/tinymistral-bf16.gguf: n_tensors = 111, total_size = 496.1M
Writing: 100%|█████████████████████████████████████████████████████████████████████████████████| 496M/496M [00:05<00:00, 94.4Mbyte/s]
INFO:hf-to-gguf:Model successfully exported to /srv/LLMstash/tmp/bf16-tests/tinymistral-bf16.gguf.
Where the output file name is present twice.
And when using split options, the final name would not exist.
INFO:gguf.gguf_writer:Writing the following files:
INFO:gguf.gguf_writer:/srv/LLMstash/tmp/gguf-split-tests/tinymistral-100M/tinymistral-q8_0-00001-of-00003.gguf: n_tensors = 17, total_size = 99.5M
INFO:gguf.gguf_writer:/srv/LLMstash/tmp/gguf-split-tests/tinymistral-100M/tinymistral-q8_0-00002-of-00003.gguf: n_tensors = 58, total_size = 99.5M
INFO:gguf.gguf_writer:/srv/LLMstash/tmp/gguf-split-tests/tinymistral-100M/tinymistral-q8_0-00003-of-00003.gguf: n_tensors = 36, total_size = 64.7M
Shard (3/3): 100%|███████████████████████████████████████████████████████████████████████████| 64.7M/64.7M [00:00<00:00, 70.0Mbyte/s]
Writing: 100%|█████████████████████████████████████████████████████████████████████████████████| 264M/264M [00:07<00:00, 33.4Mbyte/s]
INFO:hf-to-gguf:Model successfully exported to /srv/LLMstash/tmp/gguf-split-tests/tinymistral-100M/tinymistral-q8_0.gguf.
$ ls /srv/LLMstash/tmp/gguf-split-tests/tinymistral-100M/
tinymistral-q8_0-00001-of-00003.gguf tinymistral-q8_0-00002-of-00003.gguf tinymistral-q8_0-00003-of-00003.gguf
But it might still be useful when not splitting.
Updates the output of to support printing the directory if the output is split into multiple files. Also the output file name is now retrieved from the model_instance object. Signed-off-by: Daniel Bevenius <[email protected]>
Ah sorry, I see it now, for some reason I just missed it :( Now that I know where to look I'm happy with not having the output file name/path in the final output, but perhaps it might be nice to have it just the same in case others run into the same issue I did. I'll push a commit with a suggestion with the changes you suggested and also include printing the directory when the conversion performs a split. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry, I see it now, for some reason I just missed it :(
but perhaps it might be nice to have it just the same in case others run into the same issue I did.
I agree, this should reduce confusion.
Good idea with the output directory name when splitting.
Use parent attribute of Path object and string interpolation. Signed-off-by: Daniel Bevenius <[email protected]>
Use os.sep instead of hardcoding the path separator. Signed-off-by: Daniel Bevenius <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
* convert-hf : print output file name when completed This commit adds the output file name to the log message when the conversion is completed. The motivation for this change is that when `--outfile` option is not specified it migth not be obvious where the output file is written. With this change the output of running the script will be something like the following: ```console INFO:hf-to-gguf:Model successfully exported to models/gemma-2-9b-it.gguf. ``` Signed-off-by: Daniel Bevenius <[email protected]> * squash! convert-hf : print output file name when completed Updates the output of to support printing the directory if the output is split into multiple files. Also the output file name is now retrieved from the model_instance object. Signed-off-by: Daniel Bevenius <[email protected]> * squash! convert-hf : print output file name when completed Use parent attribute of Path object and string interpolation. Signed-off-by: Daniel Bevenius <[email protected]> * squash! convert-hf : print output file name when completed Use os.sep instead of hardcoding the path separator. Signed-off-by: Daniel Bevenius <[email protected]> --------- Signed-off-by: Daniel Bevenius <[email protected]>
This commit adds the output file name to the log message when the conversion is completed.
The motivation for this change is that when
--outfile
option is not specified it migth not be obvious where the output file is written.With this change the output of running the script will be something like the following:
INFO:hf-to-gguf:Model successfully exported to models/gemma-2-9b-it.gguf.