Josh Yan 10 months ago
parent
commit
29ecfe493b
1 changed files with 18 additions and 0 deletions
  1. 18 0
      llm/gguf.go

+ 18 - 0
llm/gguf.go

@@ -695,3 +695,21 @@ func (llm *gguf) Encode(ws io.WriteSeeker, kv KV, tensors []Tensor) error {
 func (gguf) padding(offset, align int64) int64 {
 	return (align - offset%align) % align
 }
+
+// Reader and WriterTo
+type GGUFWriter struct {
+	KV KV
+	T  []*Tensor
+}
+
+var _ io.Reader = (*GGUFWriter)(nil)
+
+var _ io.WriterTo = (*GGUFWriter)(nil)
+
+func (GGUFWriter) Read([]byte) (int, error) {
+	panic("not implemeneted")
+}
+
+func (gguf GGUFWriter) WriteTo(w io.Writer) (int64, error) {
+	
+}