File tree Expand file tree Collapse file tree 1 file changed +3
-15
lines changed
Expand file tree Collapse file tree 1 file changed +3
-15
lines changed Original file line number Diff line number Diff line change @@ -355,22 +355,10 @@ func (c *Client) fullModelID(id string) (string, error) {
355355 return m .ID , nil
356356 }
357357 }
358- // If not found with exact match, try partial name matching
359- for _ , tag := range m .Tags {
360- // Extract the model name without tag part (e.g., from "ai/smollm2:latest" get "ai/smollm2")
361- tagWithoutVersion := tag
362- if idx := strings .LastIndex (tag , ":" ); idx != - 1 {
363- tagWithoutVersion = tag [:idx ]
364- }
365358
366- // Get just the name part without organization (e.g., from "ai/smollm2" get "smollm2")
367- namePart := tagWithoutVersion
368- if idx := strings .LastIndex (tagWithoutVersion , "/" ); idx != - 1 {
369- namePart = tagWithoutVersion [idx + 1 :]
370- }
371-
372- // Check if the ID matches the name part
373- if namePart == id {
359+ // Normalize everything and try to find exact matches
360+ for _ , tag := range m .Tags {
361+ if dmrm .NormalizeModelName (tag ) == dmrm .NormalizeModelName (id ) {
374362 return m .ID , nil
375363 }
376364 }
You can’t perform that action at this time.
0 commit comments