People: Skip midpoint calculation if dimensions don't match #22

This commit is contained in:
theresa 2021-08-25 17:53:45 +02:00
parent 7a90c0209e
commit c99059567a

View file

@ -22,6 +22,10 @@ func EmbeddingsMidpoint(m Embeddings) (result Embedding, radius float64, count i
continue
}
if len(m[i]) != len(m[i-1]) {
continue
}
for j, val := range result {
result[j] = (val + emb[j]) / 2
}