Skip to content

Commit 9983314

Browse files
authored
Merge pull request #336 from jwjohns/feature/context-size-in-list
fix(cli): log context parsing errors
2 parents 9fb52f7 + 960df0e commit 9983314

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cmd/cli/commands/list.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,15 @@ func appendRow(table *tablewriter.Table, tag string, model dmrm.Model) {
158158
}
159159
// Strip default "ai/" prefix and ":latest" tag for display
160160
displayTag := stripDefaultsFromModelName(tag)
161-
contextSize := "-"
161+
contextSize := ""
162162
if model.Config.ContextSize != nil {
163163
contextSize = fmt.Sprintf("%d", *model.Config.ContextSize)
164164
} else if model.Config.GGUF != nil {
165165
if v, ok := model.Config.GGUF["llama.context_length"]; ok {
166166
if parsed, err := strconv.ParseUint(v, 10, 64); err == nil {
167167
contextSize = fmt.Sprintf("%d", parsed)
168+
} else {
169+
fmt.Fprintf(os.Stderr, "invalid context length %q for model %s: %v\n", v, model.ID, err)
168170
}
169171
}
170172
}

0 commit comments

Comments
 (0)