alpha
Login
or
Join now
julien.rbrt.fr
/
glean
Star
3
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
The social RSS reader. Built on AT Protocol.
glean.at
Star
3
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
Inline function in cluster
author
Julien Robert
date
1 month ago
(May 18, 2026, 12:10 AM +0200)
commit
01468b3b
01468b3b0cc77b5e62adf7ae5f298306e8c88bfa
parent
38f33851
38f33851c8caab05794dc78bc426ea6258a36a49
+7
-2
1 changed file
Expand all
Collapse all
Unified
Split
internal
ml
embed.go
+7
-2
internal/ml/embed.go
Reviewed
···
1
1
package ml
2
2
3
3
import (
4
4
+
"bytes"
4
5
"context"
6
6
+
"encoding/binary"
5
7
"unsafe"
6
8
7
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
96
-
return vec.SerializeFloat32(sum)
97
97
+
buf := new(bytes.Buffer)
98
98
+
if err := binary.Write(buf, binary.LittleEndian, sum); err != nil {
99
99
+
return nil, err
100
100
+
}
101
101
+
return buf.Bytes(), nil
97
102
}
98
103
99
104
func BytesToFloat32s(data []byte, expectedDim int) []float32 {