remove unused code
This commit is contained in:
parent
6a19724d5f
commit
3ec4ebc562
2 changed files with 2 additions and 19 deletions
|
@ -605,22 +605,14 @@ func PullModel(name, username, password string, fn func(api.ProgressResponse)) e
|
||||||
}
|
}
|
||||||
|
|
||||||
var layers []*Layer
|
var layers []*Layer
|
||||||
var total int
|
layers = append(layers, manifest.Layers...)
|
||||||
var completed int
|
|
||||||
for _, layer := range manifest.Layers {
|
|
||||||
layers = append(layers, layer)
|
|
||||||
total += layer.Size
|
|
||||||
}
|
|
||||||
layers = append(layers, &manifest.Config)
|
layers = append(layers, &manifest.Config)
|
||||||
total += manifest.Config.Size
|
|
||||||
|
|
||||||
for _, layer := range layers {
|
for _, layer := range layers {
|
||||||
if err := downloadBlob(mp, layer.Digest, username, password, fn); err != nil {
|
if err := downloadBlob(mp, layer.Digest, username, password, fn); err != nil {
|
||||||
fn(api.ProgressResponse{Status: fmt.Sprintf("error downloading: %v", err), Digest: layer.Digest})
|
fn(api.ProgressResponse{Status: fmt.Sprintf("error downloading: %v", err), Digest: layer.Digest})
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
completed += layer.Size
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn(api.ProgressResponse{Status: "writing manifest"})
|
fn(api.ProgressResponse{Status: "writing manifest"})
|
||||||
|
@ -635,7 +627,7 @@ func PullModel(name, username, password string, fn func(api.ProgressResponse)) e
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = os.WriteFile(fp, manifestJSON, 0644)
|
err = os.WriteFile(fp, manifestJSON, 0o644)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("couldn't write to %s", fp)
|
log.Printf("couldn't write to %s", fp)
|
||||||
return err
|
return err
|
||||||
|
|
|
@ -18,15 +18,6 @@ import (
|
||||||
"github.com/jmorganca/ollama/llama"
|
"github.com/jmorganca/ollama/llama"
|
||||||
)
|
)
|
||||||
|
|
||||||
func cacheDir() string {
|
|
||||||
home, err := os.UserHomeDir()
|
|
||||||
if err != nil {
|
|
||||||
panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return filepath.Join(home, ".ollama")
|
|
||||||
}
|
|
||||||
|
|
||||||
func generate(c *gin.Context) {
|
func generate(c *gin.Context) {
|
||||||
start := time.Now()
|
start := time.Now()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue