This pull request fixes a small issue on script python/merge_lora_into_ggml.py.
Program should always fail if arch_version or data format does not satisfy the preconditions in the program. However, the file merge_lora_into_ggml.py uses assert statements, sometimes being ignored under high optimization level. We uses if-statements here, where those preconditions would always execute, whether the environment enable assert stateuements or not.
This pull request fixes a small issue on script
python/merge_lora_into_ggml.py
.Program should always fail if
arch_version
or data format does not satisfy the preconditions in the program. However, the filemerge_lora_into_ggml.py
usesassert
statements, sometimes being ignored under high optimization level. We usesif
-statements here, where those preconditions would always execute, whether the environment enable assert stateuements or not.Ref: https://stackoverflow.com/questions/61826628/what-is-the-advantage-if-any-of-using-assert-over-an-if-else-condition . Here, our checks are still in effect when
-O
flag is enabled, soif __debug__:
(implied inassert
statements) is not necessary.