File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -218,6 +218,13 @@ func packageModel(cmd *cobra.Command, opts packageOptions) error {
218218 // Process directory tar archives
219219 var tempDirTarFiles []string
220220 if len (opts .dirTarPaths ) > 0 {
221+ // Schedule cleanup of temp tar files
222+ defer func () {
223+ for _ , tempFile := range tempDirTarFiles {
224+ os .Remove (tempFile )
225+ }
226+ }()
227+
221228 // Determine base directory for resolving relative paths
222229 var baseDir string
223230 if opts .safetensorsDir != "" {
@@ -262,13 +269,6 @@ func packageModel(cmd *cobra.Command, opts packageOptions) error {
262269 return fmt .Errorf ("add directory tar: %w" , err )
263270 }
264271 }
265-
266- // Schedule cleanup of temp tar files after build completes
267- defer func () {
268- for _ , tempFile := range tempDirTarFiles {
269- os .Remove (tempFile )
270- }
271- }()
272272 }
273273
274274 if opts .push {
You can’t perform that action at this time.
0 commit comments