From 437ad32a65c3e2ef164ef9b294aa2e63efa354c1 Mon Sep 17 00:00:00 2001 From: Roman Date: Sun, 27 Oct 2024 16:44:56 +0400 Subject: [PATCH] moved --- internal/cosine/simd/simd.go | 4 ++-- {eval => internal/eval}/main.go | 4 ++-- {eval => internal/eval}/main_test.go | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename {eval => internal/eval}/main.go (98%) rename {eval => internal/eval}/main_test.go (100%) diff --git a/internal/cosine/simd/simd.go b/internal/cosine/simd/simd.go index b74bdb4..ecfdfd1 100644 --- a/internal/cosine/simd/simd.go +++ b/internal/cosine/simd/simd.go @@ -23,7 +23,7 @@ var pool = sync.Pool{ }, } -// Matmul multiplies matrix M by N and writes the result into dst +// Cosine calculates the cosine similarity between two vectors func Cosine(a, b []float32) float64 { if len(a) != len(b) { panic("vectors must be of same length") @@ -37,7 +37,7 @@ func Cosine(a, b []float32) float64 { pool.Put(out) return result default: - return float64(cosine(a, b)) + return cosine(a, b) } } diff --git a/eval/main.go b/internal/eval/main.go similarity index 98% rename from eval/main.go rename to internal/eval/main.go index 24fbb04..78edf0d 100644 --- a/eval/main.go +++ b/internal/eval/main.go @@ -15,7 +15,7 @@ import ( ) func loadModel() *search.Vectorizer { - model := "../dist/MiniLM-L6-v2.Q8_0.gguf" + model := "../../dist/MiniLM-L6-v2.Q8_0.gguf" fmt.Printf("Loading model: %s\n", model) mod, _ := filepath.Abs(model) @@ -83,7 +83,7 @@ type entry struct { // loadSICK parses the SICK CSV dataset and returns sentence pairs with their relatedness scores func loadSICK() ([]entry, error) { - file, err := os.Open("../dist/dataset.txt") + file, err := os.Open("../../dist/dataset.txt") if err != nil { return nil, err } diff --git a/eval/main_test.go b/internal/eval/main_test.go similarity index 100% rename from eval/main_test.go rename to internal/eval/main_test.go