{{ message }}
Repository navigation
Allow --launch together with --file/--accuracy in llamafile CLI - #1807
Open
MohammadHijjawi97 wants to merge 1 commit into
Open
MohammadHijjawi97 wants to merge 1 commit into
MohammadHijjawi97 wants to merge 1 commit into
Conversation
`--launch` was registered in the same mutually exclusive group as
`--accuracy` and `--file`, so choosing a specific llamafile or accuracy
and skipping the launch at the same time was rejected by argparse:
modelscope llamafile --model <id> --file <name>.llamafile --launch False
error: argument --launch: not allowed with argument --file
Only `--accuracy` and `--file` are meant to exclude each other, so
register `--launch` on the parser itself.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

--launchis registered in the same mutually exclusive argparse group as--accuracyand--file. So you cannot pick a specific llamafile (or accuracy) and skip launching it at the same time:The same happens with
--accuracy q8_0 --launch False. Only--accuracyand--fileare meant to exclude each other; the code already documents thatfiletakes precedence overaccuracy. This PR registers--launchon the parser itself instead of the group.Test: added
test_launch_with_accuracy_or_filetotests/cli/test_llamfafile_cmd.py. It parses both combinations offline, fails on master, and passes with this change. The existing check that--fileand--accuracystay mutually exclusive still passes. flake8, isort and yapf are clean on the changed files.