Skip to content

Commit 16a8ac5

Browse files
committed
feat(unpack): streamline V0.2 model unpacking logic in Unpack function
1 parent 6674c88 commit 16a8ac5

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

pkg/distribution/internal/bundle/unpack.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@ import (
1818
// - V0.2 (layer-per-file with annotations): Uses UnpackFromLayers for full path preservation
1919
// - V0.1 (legacy): Uses the original unpacking logic based on GGUFPaths(), SafetensorsPaths(), etc.
2020
func Unpack(dir string, model types.Model) (*Bundle, error) {
21-
// Check if the model uses V0.2 packaging (layer-per-file with annotations)
22-
if artifact, ok := model.(types.ModelArtifact); ok {
23-
if isV02Model(artifact) {
24-
return UnpackFromLayers(dir, artifact)
25-
}
21+
artifact, isArtifact := model.(types.ModelArtifact)
22+
if isArtifact && isV02Model(artifact) {
23+
return UnpackFromLayers(dir, artifact)
2624
}
2725

2826
// V0.1 legacy unpacking

0 commit comments

Comments
 (0)