mirror of
https://github.com/ollama/ollama.git
synced 2025-05-11 10:26:53 +02:00
Fix absolute path names + gguf detection (#8428)
This commit is contained in:
parent
61676fb506
commit
2539f2dbf9
4 changed files with 217 additions and 28 deletions
|
@ -564,7 +564,9 @@ func isValidCommand(cmd string) bool {
|
|||
}
|
||||
|
||||
func expandPathImpl(path, relativeDir string, currentUserFunc func() (*user.User, error), lookupUserFunc func(string) (*user.User, error)) (string, error) {
|
||||
if strings.HasPrefix(path, "~") {
|
||||
if filepath.IsAbs(path) || strings.HasPrefix(path, "\\") || strings.HasPrefix(path, "/") {
|
||||
return filepath.Abs(path)
|
||||
} else if strings.HasPrefix(path, "~") {
|
||||
var homeDir string
|
||||
|
||||
if path == "~" || strings.HasPrefix(path, "~/") {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue