-
Notifications
You must be signed in to change notification settings - Fork 681
Add -no-cnv flag support to ggml generators #1189
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
|
DCO Assistant Lite bot All contributors have signed the DCO ✍️ ✅ |
|
I have read the DCO Document and I hereby sign the DCO |
By default, garak ggml generators invoke the ggml main binary (now llama-cli) in interactive mode, causing the process to hang and never return control to garak. This commit: • Modifies the command-building loop to always append each flag key, appending its value only if not None. • Adds `"-no-cnv": None` to `command_params()`, ensuring the pure `-no-cnv` flag is passed to llama-cli to disable interactive mode. With this change, garak ggml generators can scan model normally when using the ggml main binary. Signed-off-by: Ian Chu <[email protected]>
60d0714 to
4016941
Compare
|
This looks to be a change in behavior since introduced recently. I think there needs to be an option to suppress this functionality as users bring their own binary which may nor may not be a version that works as expected with this flag. |
|
This provides a good explanation of the issue I encountered. When scanning the ggml/gguf local model, the automatic activation of the cnv flag (due to ggml-org/llama.cpp#11214) may cause the inability to return to garak. Therefore, I added the -no-cnv flag to mitigate this issue. |
This is close to what I am suggesting, generators have Something like below would allow the user to provide a dictionary of additional parameters in the future or even suppress the default with an empty DEFAULT_PARAMS = Generator.DEFAULT_PARAMS | {
"repeat_penalty": 1.1,
"presence_penalty": 0.0,
"frequency_penalty": 0.0,
"top_k": 40,
"top_p": 0.95,
"temperature": 0.8,
"exception_on_failure": True,
"first_call": True,
"key_env_var": ENV_VAR,
"extra_params": {
"-no-cnv": None
},
}
generator_family_name = "ggml"
def command_params(self):
extra_params = self.extra_params if self.extra_params is not None else {}
return {
"-m": self.name,
"-n": self.max_tokens,
"--repeat-penalty": self.repeat_penalty,
"--presence-penalty": self.presence_penalty,
"--frequency-penalty": self.frequency_penalty,
"--top-k": self.top_k,
"--top-p": self.top_p,
"--temp": self.temperature,
"-s": self.seed,
} | extra_params |
|
@jmartin-tech Thanks, your suggestion is definitely a more generic approach. From what I can see, Would it make sense to keep this PR minimal: adding the I’m happy to proceed whichever path best fits the release timeline. Thanks again! |
|
Each plugin can define the I actually realized a mistake in my suggestion as currently any Lists however are replaced instead of merged, Maybe something like: This would then allow suppression via configuration by setting: I can offer this up as a PR against your branch in the next day or so if you can test and see if it turns out viable. |
To allow for future compatibility with cli arguments to the ggml binary extra flags and parameters can be passed via configuration. * add `-no-cnv` as a default added flag * allow supply of a list of additional flags * allow supply of additional arguement and value pairs * keep suppression of projected params when set to `None` Signed-off-by: Jeffrey Martin <[email protected]>
erickgalinkin
left a comment
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.
LGTM! Awesome work.
By default, garak ggml generators invoke the ggml main binary (now llama-cli) in interactive mode, causing the process to hang and never return control to garak.
To allow for future compatibility with cli arguments to the ggml binary extra flags and parameters can be passed via configuration.
-no-cnvas a default added flagNoneVerification
List the steps needed to make sure this thing works
GgmlGeneratorconfigurationGgmlGenerator-no-cnvflag with following config:{ "ggml": { "GgmlGenerator": { "extra_ggml_flags": null } } }