Skip to content

Commit fb5a1fa

Browse files
committed
fix(parse): validate model subdirectory existence for new bundle format
1 parent 5c7c839 commit fb5a1fa

File tree

1 file changed

+5
-1
lines changed
  • pkg/distribution/internal/bundle

1 file changed

+5
-1
lines changed

pkg/distribution/internal/bundle/parse.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@ func Parse(rootDir string) (*Bundle, error) {
1515
return nil, fmt.Errorf("inspect bundle root dir: %w", err)
1616
}
1717

18-
// Model files are now located in the model/ subdirectory
18+
// Check if model subdirectory exists - required for new bundle format
19+
// If it doesn't exist, this is an old bundle format that needs to be recreated
1920
modelDir := filepath.Join(rootDir, ModelSubdir)
21+
if _, err := os.Stat(modelDir); os.IsNotExist(err) {
22+
return nil, fmt.Errorf("bundle uses old format (missing %s subdirectory), will be recreated", ModelSubdir)
23+
}
2024

2125
ggufPath, err := findGGUFFile(modelDir)
2226
if err != nil {

0 commit comments

Comments
 (0)