diff --git a/commands/ps.go b/commands/ps.go index 67d5d656..293e0b8b 100644 --- a/commands/ps.go +++ b/commands/ps.go @@ -2,6 +2,7 @@ package commands import ( "bytes" + "strings" "time" "github.com/docker/go-units" @@ -50,8 +51,12 @@ func psTable(ps []desktop.BackendStatus) string { table.SetHeaderAlignment(tablewriter.ALIGN_LEFT) for _, status := range ps { + modelName := status.ModelName + if strings.HasPrefix(modelName, "sha256:") { + modelName = modelName[7:19] + } table.Append([]string{ - status.ModelName, + modelName, status.BackendName, status.Mode, units.HumanDuration(time.Since(status.LastUsed)) + " ago", diff --git a/commands/run.go b/commands/run.go index 25a378bf..cbe4f060 100644 --- a/commands/run.go +++ b/commands/run.go @@ -37,17 +37,15 @@ func newRunCmd() *cobra.Command { return fmt.Errorf("unable to initialize standalone model runner: %w", err) } - modelDetail, err := desktopClient.Inspect(model, false) + _, err := desktopClient.Inspect(model, false) if err != nil { if !errors.Is(err, desktop.ErrNotFound) { - return handleNotRunningError(handleClientError(err, "Failed to list models")) + return handleNotRunningError(handleClientError(err, "Failed to inspect model")) } cmd.Println("Unable to find model '" + model + "' locally. Pulling from the server.") if err := pullModel(cmd, desktopClient, model); err != nil { return err } - } else if model != modelDetail.Tags[0] { - model = modelDetail.Tags[0] } if prompt != "" {