Improve floret vectors display in pipeline docs (#11343)

This commit is contained in:
Adriane Boyd 2022-08-22 11:28:13 +02:00 committed by GitHub
parent 3e4cf1bbe1
commit 04c6e5cb95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -114,7 +114,11 @@ function formatVectors(data) {
if (!data) return 'n/a'
if (Object.values(data).every(n => n === 0)) return 'context vectors only'
const { keys, vectors, width } = data
return `${abbrNum(keys)} keys, ${abbrNum(vectors)} unique vectors (${width} dimensions)`
if (keys >= 0) {
return `${abbrNum(keys)} keys, ${abbrNum(vectors)} unique vectors (${width} dimensions)`
} else {
return `${abbrNum(vectors)} floret vectors (${width} dimensions)`
}
}
function formatAccuracy(data, lang) {