add model IDs (#439)

This commit is contained in:
Patrick Devine
2023-08-28 20:50:24 -07:00
committed by GitHub
parent d3b838ce60
commit 8bbff2df98
4 changed files with 27 additions and 19 deletions

View File

@@ -373,7 +373,7 @@ func ListModelsHandler(c *gin.Context) {
tag := path[:slashIndex] + ":" + path[slashIndex+1:]
mp := ParseModelPath(tag)
manifest, err := GetManifest(mp)
manifest, digest, err := GetManifest(mp)
if err != nil {
log.Printf("skipping file: %s", fp)
return nil
@@ -381,6 +381,7 @@ func ListModelsHandler(c *gin.Context) {
model := api.ListResponseModel{
Name: mp.GetShortTagname(),
Size: manifest.GetTotalSize(),
Digest: digest,
ModifiedAt: fi.ModTime(),
}
models = append(models, model)