-
Notifications
You must be signed in to change notification settings - Fork 12.2k
quantize : make output filename optional again #2823
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
Conversation
Hi, Unrelated to this PR specifically: I'm getting an error with
Here's my attempt: I understand if it cannot be enabled, but figured I'd ask anyway. Thank you. |
Try |
While fixing this, can we also fix the destination path when using diff --git a/examples/quantize/quantize.cpp b/examples/quantize/quantize.cpp
index 0e3a26b..df9a214 100644
--- a/examples/quantize/quantize.cpp
+++ b/examples/quantize/quantize.cpp
@@ -114,7 +114,7 @@ int main(int argc, char ** argv) {
std::string ftype_str;
if (try_parse_ftype(argv[arg_idx], params.ftype, ftype_str)) {
std::string fpath;
- const size_t pos = fname_inp.find_last_of('/');
+ const size_t pos = fname_inp.find_last_of("/\\");
if (pos != std::string::npos) {
fpath = fname_inp.substr(0, pos + 1);
} |
I successfully converted, thank you. |
suggested by @slaren
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.
Thanks for fixing this, I think you're right about it being an oversight. I reaaaallly hate the way the quantize tool handles arguments in general. I think it's better to be explicit than have weird magical behavior with positional arguments.
It was probably quantized with |
* quantize : make output filename optional again * quantize : fix path parsing on Windows suggested by @slaren
Commit 5c7b0e7 removed the ability to simply call quantize with an input filename and a quantization type, like this:
The output filename may be omitted if you pass a value for nthreads. In other words, the script works as long as you pass at least three arguments, but two of the four are optional.
This was presumably unintentional. Changing the minimum argument count to two makes the behavior of quantize match the usage string: