Skip to content
This repository was archived by the owner on Oct 6, 2025. It is now read-only.

Commit 536a638

Browse files
authored
Merge pull request #116 from doringeman/fixes
run: Use the provided model reference
2 parents ff2ef18 + 09e62b8 commit 536a638

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

commands/ps.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package commands
22

33
import (
44
"bytes"
5+
"strings"
56
"time"
67

78
"github.com/docker/go-units"
@@ -50,8 +51,12 @@ func psTable(ps []desktop.BackendStatus) string {
5051
table.SetHeaderAlignment(tablewriter.ALIGN_LEFT)
5152

5253
for _, status := range ps {
54+
modelName := status.ModelName
55+
if strings.HasPrefix(modelName, "sha256:") {
56+
modelName = modelName[7:19]
57+
}
5358
table.Append([]string{
54-
status.ModelName,
59+
modelName,
5560
status.BackendName,
5661
status.Mode,
5762
units.HumanDuration(time.Since(status.LastUsed)) + " ago",

commands/run.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,15 @@ func newRunCmd() *cobra.Command {
3737
return fmt.Errorf("unable to initialize standalone model runner: %w", err)
3838
}
3939

40-
modelDetail, err := desktopClient.Inspect(model, false)
40+
_, err := desktopClient.Inspect(model, false)
4141
if err != nil {
4242
if !errors.Is(err, desktop.ErrNotFound) {
43-
return handleNotRunningError(handleClientError(err, "Failed to list models"))
43+
return handleNotRunningError(handleClientError(err, "Failed to inspect model"))
4444
}
4545
cmd.Println("Unable to find model '" + model + "' locally. Pulling from the server.")
4646
if err := pullModel(cmd, desktopClient, model); err != nil {
4747
return err
4848
}
49-
} else if model != modelDetail.Tags[0] {
50-
model = modelDetail.Tags[0]
5149
}
5250

5351
if prompt != "" {

0 commit comments

Comments
 (0)