resolve FROM path before sending modelfile (#1211)

This commit is contained in:
Bruce MacDonald 2023-11-20 16:43:48 -05:00 committed by GitHub
parent 35c4b5ec16
commit 31ab453d37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -82,6 +82,10 @@ func CreateHandler(cmd *cobra.Command, args []string) error {
path = filepath.Join(home, path[2:]) path = filepath.Join(home, path[2:])
} }
if !filepath.IsAbs(path) {
path = filepath.Join(filepath.Dir(filename), path)
}
bin, err := os.Open(path) bin, err := os.Open(path)
if errors.Is(err, os.ErrNotExist) && c.Name == "model" { if errors.Is(err, os.ErrNotExist) && c.Name == "model" {
continue continue