The social RSS reader. Built on AT Protocol. glean.at
3

Configure Feed

Select the types of activity you want to include in your feed.

Inline function in cluster

+7 -2
+7 -2
internal/ml/embed.go
··· 1 1 package ml 2 2 3 3 import ( 4 + "bytes" 4 5 "context" 6 + "encoding/binary" 5 7 "unsafe" 6 8 7 - vec "github.com/asg017/sqlite-vec-go-bindings/cgo" 8 9 "github.com/openai/openai-go" 9 10 "github.com/openai/openai-go/option" 10 11 ) ··· 93 94 for j := range sum { 94 95 sum[j] /= float32(count) 95 96 } 96 - return vec.SerializeFloat32(sum) 97 + buf := new(bytes.Buffer) 98 + if err := binary.Write(buf, binary.LittleEndian, sum); err != nil { 99 + return nil, err 100 + } 101 + return buf.Bytes(), nil 97 102 } 98 103 99 104 func BytesToFloat32s(data []byte, expectedDim int) []float32 {