LocalAI/backend/go
Richard Palethorpe e8eb0b2c50
fix(stores): Stores fixes and testing (#4663)
* fix(stores): Actually check a vector is a unit vector/normalized

Instead of just summing the components to see if they equal 1.0, take
the actual magnitude/p-norm of the vector and check that is
approximately 1.0.

Note that this shouldn't change the order of results except in edge
cases if I am too lax with the precision of the equality
comparison. However it should improve performance for normalized
vectors which were being misclassified.

Signed-off-by: Richard Palethorpe <io@richiejp.com>

* fix(stores): Add tests for known results and triangle inequality

This adds some more tests to check the cosine similarity function has
some expected mathematical properties.

Signed-off-by: Richard Palethorpe <io@richiejp.com>

---------

Signed-off-by: Richard Palethorpe <io@richiejp.com>
2025-01-22 19:35:05 +01:00
..
bark feat(bark-cpp): add new bark.cpp backend (#4287) 2024-11-28 22:16:44 +01:00
image/stablediffusion-ggml chore(stablediffusion-ncn): drop in favor of ggml implementation (#4652) 2025-01-22 19:34:16 +01:00
llm feat(backends): Drop bert.cpp (#4272) 2024-11-27 16:34:28 +01:00
stores fix(stores): Stores fixes and testing (#4663) 2025-01-22 19:35:05 +01:00
transcribe/whisper fix: untangle pkg/grpc and core/schema for Transcription (#3419) 2024-09-02 15:48:53 +02:00
tts chore: fix go.mod module (#2635) 2024-06-23 08:24:36 +00:00
vad/silero feat(silero): add Silero-vad backend (#4204) 2024-11-20 14:48:40 +01:00