Skip to content

Commit

Permalink
convert/llama: use WriteSeeker
Browse files Browse the repository at this point in the history
  • Loading branch information
mxyng committed May 6, 2024
1 parent 2a2a55a commit c7b228a
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions convert/llama.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"io"
"log/slog"
"os"
"regexp"
"strings"

Expand Down Expand Up @@ -159,11 +158,5 @@ func (m *LlamaModel) WriteGGUF(ws io.WriteSeeker) error {
"tokenizer.ggml.add_eos_token": false,
}

f, err := os.CreateTemp("", "ollama-gguf")
if err != nil {
return err
}
defer f.Close()

return llm.NewGGUFV3(m.Params.ByteOrder).Encode(f, kv, m.Tensors)
return llm.NewGGUFV3(m.Params.ByteOrder).Encode(ws, kv, m.Tensors)
}

0 comments on commit c7b228a

Please sign in to comment.