Skip to content
This repository was archived by the owner on Oct 6, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions commands/unload.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,12 @@ func newUnloadCmd() *cobra.Command {
var all bool
var backend string

cmdArgs := "(MODEL [--backend BACKEND] | --all)"
cmdArgs := "(MODEL [MODEL ...] [--backend BACKEND] | --all)"
c := &cobra.Command{
Use: "unload " + cmdArgs,
Short: "Unload running models",
RunE: func(cmd *cobra.Command, args []string) error {
var model string
if len(args) > 0 {
model = args[0]
}
unloadResp, err := desktopClient.Unload(desktop.UnloadRequest{All: all, Backend: backend, Model: model})
RunE: func(cmd *cobra.Command, models []string) error {
unloadResp, err := desktopClient.Unload(desktop.UnloadRequest{All: all, Backend: backend, Models: models})
if err != nil {
err = handleClientError(err, "Failed to unload models")
return handleNotRunningError(err)
Expand Down Expand Up @@ -58,9 +54,6 @@ func newUnloadCmd() *cobra.Command {
"See 'docker model unload --help' for more information.",
)
}
if len(args) > 1 {
return fmt.Errorf("too many arguments, expected " + cmdArgs)
}
return nil
}
c.Flags().BoolVar(&all, "all", false, "Unload all running models")
Expand Down
6 changes: 3 additions & 3 deletions desktop/desktop.go
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,9 @@ func (c *Client) DF() (DiskUsage, error) {

// UnloadRequest to be imported from docker/model-runner when https://github.com/docker/model-runner/pull/46 is merged.
type UnloadRequest struct {
All bool `json:"all"`
Backend string `json:"backend"`
Model string `json:"model"`
All bool `json:"all"`
Backend string `json:"backend"`
Models []string `json:"models"`
}

// UnloadResponse to be imported from docker/model-runner when https://github.com/docker/model-runner/pull/46 is merged.
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/docker_model_unload.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
command: docker model unload
short: Unload running models
long: Unload running models
usage: docker model unload (MODEL [--backend BACKEND] | --all)
usage: docker model unload (MODEL [MODEL ...] [--backend BACKEND] | --all)
pname: docker model
plink: docker_model.yaml
options:
Expand Down