initial commit: create basic rag search and ingest
This commit is contained in:
36
backend/datastore/mapper_test.go
Normal file
36
backend/datastore/mapper_test.go
Normal file
@ -0,0 +1,36 @@
|
||||
package datastore
|
||||
|
||||
import "testing"
|
||||
|
||||
func Benchmark_mySerializedEmbeddings(b *testing.B) {
|
||||
type args struct {
|
||||
embeddings []float32
|
||||
}
|
||||
tests := []struct {
|
||||
name string
|
||||
args args
|
||||
want string
|
||||
}{
|
||||
{
|
||||
name: "Test 1",
|
||||
args: args{
|
||||
embeddings: []float32{0.1, 0.2, 0.3},
|
||||
},
|
||||
want: "[0.1, 0.2, 0.3]",
|
||||
},
|
||||
{
|
||||
name: "Crazy long test",
|
||||
args: args{
|
||||
embeddings: []float32{0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0},
|
||||
},
|
||||
want: "[0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1]",
|
||||
},
|
||||
}
|
||||
for _, tt := range tests {
|
||||
b.Run(tt.name, func(t *testing.B) {
|
||||
if got := serializeEmbeddings(tt.args.embeddings); got != tt.want {
|
||||
t.Errorf("mySerializedEmbeddings() = %v, want %v", got, tt.want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user