-
Notifications
You must be signed in to change notification settings - Fork 82
get --runtime-args back #518
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,15 +11,27 @@ func newConfigureCmd() *cobra.Command { | |
| var flags ConfigureFlags | ||
|
|
||
| c := &cobra.Command{ | ||
| Use: "configure [--context-size=<n>] [--speculative-draft-model=<model>] [--hf_overrides=<json>] [--gpu-memory-utilization=<float>] [--mode=<mode>] [--think] MODEL", | ||
| Use: "configure [--context-size=<n>] [--speculative-draft-model=<model>] [--hf_overrides=<json>] [--gpu-memory-utilization=<float>] [--mode=<mode>] [--think] MODEL [-- <runtime-flags...>]", | ||
| Short: "Configure runtime options for a model", | ||
| Hidden: true, | ||
| Args: func(cmd *cobra.Command, args []string) error { | ||
| if len(args) != 1 { | ||
| return fmt.Errorf( | ||
| "Exactly one model must be specified, got %d: %v\n\n"+ | ||
| "See 'docker model configure --help' for more information", | ||
| len(args), args) | ||
| argsBeforeDash := cmd.ArgsLenAtDash() | ||
| if argsBeforeDash == -1 { | ||
| // No "--" used, so we need exactly 1 total argument. | ||
| if len(args) != 1 { | ||
| return fmt.Errorf( | ||
| "Exactly one model must be specified, got %d: %v\n\n"+ | ||
| "See 'docker model configure --help' for more information", | ||
| len(args), args) | ||
| } | ||
| } else { | ||
| // Has "--", so we need exactly 1 argument before it. | ||
| if argsBeforeDash != 1 { | ||
| return fmt.Errorf( | ||
| "Exactly one model must be specified before --, got %d\n\n"+ | ||
| "See 'docker model configure --help' for more information", | ||
| argsBeforeDash) | ||
| } | ||
| } | ||
| return nil | ||
| }, | ||
|
|
@@ -29,6 +41,7 @@ func newConfigureCmd() *cobra.Command { | |
| if err != nil { | ||
| return err | ||
| } | ||
| opts.RuntimeFlags = args[1:] | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. issue (bug_risk): Runtime flags slice includes the model name and likely the literal "--" Here |
||
| return desktopClient.ConfigureBackend(opts) | ||
| }, | ||
| ValidArgsFunction: completion.ModelNames(getDesktopClient, -1), | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.