Skip to content

Commit fa1b799

Browse files
committed
set threads test to numCPU, max 6
1 parent 2917fb8 commit fa1b799

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

hugot_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"encoding/json"
66
"fmt"
77
"math"
8+
"runtime"
89
"slices"
910
"strings"
1011
"testing"
@@ -1137,7 +1138,7 @@ func textGenerationPipelineValidation(t *testing.T, session *Session) {
11371138
// Thread safety
11381139

11391140
func threadSafety(t *testing.T, session *Session, numEmbeddings int) {
1140-
const numWorkers = 4
1141+
numWorkers := min(runtime.NumCPU(), 6)
11411142
numResults := numWorkers * numEmbeddings
11421143

11431144
t.Helper()

0 commit comments

Comments
 (0)