common: fix --override-kv to support comma-separated values#18056
common: fix --override-kv to support comma-separated values#18056ggerganov merged 6 commits intoggml-org:masterfrom
Conversation
|
I think it's OK, but would like @ngxson to confirm. |
ngxson
left a comment
There was a problem hiding this comment.
we will probably handle the case key=str:a,b where string = "a,b"
but this can be resolved later, there is a chance that no one actually use it
Co-authored-by: Xuan-Son Nguyen <[email protected]>
|
Thanks for this PR, but I feel like it just introduces more problems. It will require further changes to escape the comma, it doesn't fix the other options, and it breaks backward compatibility. I can come up with a PR today that allows multiple parameters again, it's already done locally. Would that make sense or am I misunderstanding something? |
Thanks for the feedback! I understand your concern about backward compatibility. Consistency: It matches --override-tensor (-ot) which already uses commas That said, I'm open to discussion. If the maintainers prefer keeping backward compatibility with multi-arguments, I can adjust the PR. But IMO, consistency across the codebase is more valuable than preserving a pattern that's broken in router mode anyway. |
|
@personalmountains I'm quite against supporting repeated args because as explained in the OP, the environment variable does not accept it. The |
|
also, the design of presets using so IMO we should not make repeated args a default experience, apparently other config formats like JSON or YAML doesn't want it, then why would we? |
|
Fair enough. |
|
Sorry, maybe also add a noisy warning when options are discarded? I'm just concerned about the silent backward compatibility break. This can break a model in subtle ways by failing to override certain keys. I found this by chance, really. |
|
I propose we add a warning directly in the parser for all duplicated arguments. This way everyone gets into good habits, and it allows for progressive migration toward cleaner config patterns ? |
|
Yes that sounds good. We should remove all help messages mentioning about repeated args too, so new users won't follow the same pattern |
|
For --override-kv, comma escaping could be supported for edge cases where a comma appears in the value itself: |
OK I do it on this PR |
|
It look like : DEPRECATED: argument '--override-kv' specified multiple times, use comma-separated values instead (only last value will be used) |
|
And escaping for --override-kv : string_parse_kv_override: invalid type for KV override 'tokenizer.ggml.add_eos_token=ESCAP,ING:bl,ah' |
Co-authored-by: personalmountains <[email protected]>
Should we clean up ALL "can be repeated" help text in this PR, or keep it focused on --override-kv?
What do you prefer? Edit: Turns out there weren't that many, so I migrated them all to eliminate the technical debt. |
…#18056) * common: fix --override-kv to support comma-separated values * Update common/arg.cpp Co-authored-by: Xuan-Son Nguyen <[email protected]> * common: deprecate repeated arguments, suggest comma-separated values * common: add comma escape support for --override-kv * common: optimize duplicate detection with insert().second Co-authored-by: personalmountains <[email protected]> * common: migrate all repeated args to comma-separated syntax --------- Co-authored-by: Xuan-Son Nguyen <[email protected]> Co-authored-by: personalmountains <[email protected]>
* common: fix --override-kv to support comma-separated values * Update common/arg.cpp Co-authored-by: Xuan-Son Nguyen <[email protected]> * common: deprecate repeated arguments, suggest comma-separated values * common: add comma escape support for --override-kv * common: optimize duplicate detection with insert().second Co-authored-by: personalmountains <[email protected]> * common: migrate all repeated args to comma-separated syntax --------- Co-authored-by: Xuan-Son Nguyen <[email protected]> Co-authored-by: personalmountains <[email protected]>
Make sure to read the contributing guidelines before submitting a PR
Two KV override working :
Help message :
Fixes #18040