create tempdir in models directory

the models directory should have plenty of storage and also ensure
there's no cross-device copy
This commit is contained in:
Michael Yang 2025-04-18 16:32:48 -07:00 committed by Michael Yang
parent 4e535e6188
commit 88738b357b

View file

@ -225,7 +225,7 @@ func detectModelTypeFromFiles(files map[string]string) string {
}
func convertFromSafetensors(files map[string]string, baseLayers []*layerGGML, isAdapter bool, fn func(resp api.ProgressResponse)) ([]*layerGGML, error) {
tmpDir, err := os.MkdirTemp("", "ollama-safetensors")
tmpDir, err := os.MkdirTemp(envconfig.Models(), "ollama-safetensors")
if err != nil {
return nil, err
}