use os.pathseparator

This commit is contained in:
Bruce MacDonald 2024-02-28 10:17:23 -05:00
parent 17f391c25f
commit 9051578ecb

View File

@ -108,7 +108,7 @@ func modelsDir() (string, error) {
return "", err
}
if models, exists := os.LookupEnv("OLLAMA_MODELS"); exists {
if strings.HasPrefix(models, "~/") {
if strings.HasPrefix(models, "~"+string(os.PathSeparator)) {
return filepath.Join(home, models[2:]), nil
}
return models, nil