refactor convert

This commit is contained in:
Michael Yang 2024-05-31 20:00:49 -07:00
parent 6b252918fb
commit 5e9db9fb0b
24 changed files with 1514 additions and 1494 deletions

View file

@ -2,7 +2,6 @@ package server
import (
"bytes"
"encoding/binary"
"encoding/json"
"fmt"
"io"
@ -20,7 +19,7 @@ import (
var stream bool = false
func createBinFile(t *testing.T, kv map[string]any, ti []llm.Tensor) string {
func createBinFile(t *testing.T, kv map[string]any, ti []*llm.Tensor) string {
t.Helper()
f, err := os.CreateTemp(t.TempDir(), "")
@ -29,7 +28,7 @@ func createBinFile(t *testing.T, kv map[string]any, ti []llm.Tensor) string {
}
defer f.Close()
if err := llm.NewGGUFV3(binary.LittleEndian).Encode(f, kv, ti); err != nil {
if err := llm.WriteGGUF(f, kv, ti); err != nil {
t.Fatal(err)
}