-
Notifications
You must be signed in to change notification settings - Fork 11.7k
Add oneliner for batch quantization #17
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
which can be scripted like this if you are lazy (for 65B model): | ||
|
||
```bash | ||
for i in models/65B/ggml-model-f16.bin*;do quantized=`echo "$i" | sed -e 's/f16/q4_0/'`; ./quantize "$i" "$quantized" 2 ;done |
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.
Sed is not necessary, bash, zsh and other modern shells can perform pattern replacement of a variable:
for i in models/65B/ggml-model-f16.bin*;do quantized=`echo "$i" | sed -e 's/f16/q4_0/'`; ./quantize "$i" "$quantized" 2 ;done | |
for i in models/65B/ggml-model-f16.bin* ; do ./quantize "$i" "${i/f16/q4_0}" 2 ;done |
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 will generate 'models/65B/ggml-model-q4_0/.bin.2'
such paths and will fail with errors, the right command (in bash) should be for i in models/65B/ggml-model-f16.bin* ; do ./quantize "$i" "${i/f16/q4_0}" 2 ;done
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.
@Player-205 right, updated the suggestion above, thanks
Lets put this in a
Should be much easier to follow |
Note that if the disk space is limited, it is still useful to quantize each file separately so that we could delete each intermediate file in between.
|
Good point, should have a second parameter for "keep f16" which is on by default |
Superseded by #92 |
improve docs and example
No description provided.