@@ -333,7 +333,7 @@ func editModelfile(client *api.Client, modelName string) (string, error) {
333333 logging .DebugLogger .Printf ("Using editor: %s for model: %s\n " , editor , modelName )
334334
335335 // Create a secure temporary file with random name
336- tempFile , err := os .CreateTemp ("" , fmt .Sprintf ("gollama_%s_*.modelfile" , strings .ReplaceAll (modelName , ":" , "_" )))
336+ tempFile , err := os .CreateTemp ("" , fmt .Sprintf ("gollama_%s_*.modelfile" , strings .ReplaceAll (strings . ReplaceAll ( modelName , ":" , "_" ), "/ " , "_" )))
337337 if err != nil {
338338 return "" , fmt .Errorf ("error creating temporary file: %v" , err )
339339 }
@@ -517,7 +517,7 @@ func startExternalEditor(client *api.Client, modelName string) (string, error) {
517517 logging .DebugLogger .Printf ("Starting external editor: %s for model: %s\n " , editor , modelName )
518518
519519 // Create a secure temporary file with random name
520- tempFile , err := os .CreateTemp ("" , fmt .Sprintf ("gollama_%s_*.modelfile" , strings .ReplaceAll (modelName , ":" , "_" )))
520+ tempFile , err := os .CreateTemp ("" , fmt .Sprintf ("gollama_%s_*.modelfile" , strings .ReplaceAll (strings . ReplaceAll ( modelName , ":" , "_" ), "/ " , "_" )))
521521 if err != nil {
522522 return "" , fmt .Errorf ("error creating temporary file: %v" , err )
523523 }
0 commit comments