File tree Expand file tree Collapse file tree 5 files changed +11
-6
lines changed Expand file tree Collapse file tree 5 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ require (
32
32
github.com/russross/blackfriday/v2 v2.1.0 // indirect
33
33
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect
34
34
golang.org/x/crypto v0.22.0 // indirect
35
+ golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f // indirect
35
36
golang.org/x/oauth2 v0.19.0 // indirect
36
37
golang.org/x/sys v0.19.0 // indirect
37
38
gopkg.in/yaml.v3 v3.0.1 // indirect
Original file line number Diff line number Diff line change @@ -56,6 +56,8 @@ github.com/yalue/onnxruntime_go v1.9.0 h1:AhgkpBjphJZsHT5karKt93xPkPFNP0Iz6ENUbN
56
56
github.com/yalue/onnxruntime_go v1.9.0 /go.mod h1:b4X26A8pekNb1ACJ58wAXgNKeUCGEAQ9dmACut9Sm/4 =
57
57
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30 =
58
58
golang.org/x/crypto v0.22.0 /go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M =
59
+ golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f h1:99ci1mjWVBWwJiEKYY6jWa4d2nTQVIEhZIptnrVb1XY =
60
+ golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f /go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI =
59
61
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4 =
60
62
golang.org/x/oauth2 v0.19.0 h1:9+E/EZBCbTLNrbN35fHv/a/d/mOBatymz1zbtQrXpIg =
61
63
golang.org/x/oauth2 v0.19.0 /go.mod h1:vYi7skDa1x015PmRRYZ7+s1cWyPgrPiSYRe4rnsexc8 =
Original file line number Diff line number Diff line change 4
4
"context"
5
5
"errors"
6
6
"fmt"
7
- "slices"
8
7
9
8
util "github.com/knights-analytics/hugot/utils"
10
9
@@ -34,7 +33,7 @@ func (m pipelineMap[T]) Destroy() error {
34
33
func (m pipelineMap [T ]) GetStats () []string {
35
34
var stats []string
36
35
for _ , p := range m {
37
- stats = slices . Concat (stats , p .GetStats ())
36
+ stats = append (stats , p .GetStats ()... )
38
37
}
39
38
return stats
40
39
}
@@ -299,9 +298,10 @@ func (s *Session) Destroy() error {
299
298
// the number of batch calls to the onnxruntime inference
300
299
// the average time per onnxruntime inference batch call
301
300
func (s * Session ) GetStats () []string {
302
- return slices .Concat (s .tokenClassificationPipelines .GetStats (),
301
+ // slices.Concat() is not implemented in experimental x/exp/slices package
302
+ return append (s .tokenClassificationPipelines .GetStats (),
303
303
s .textClassificationPipelines .GetStats (),
304
- s .featureExtractionPipelines .GetStats (),
304
+ s .featureExtractionPipelines .GetStats ()...
305
305
)
306
306
}
307
307
Original file line number Diff line number Diff line change @@ -3,9 +3,11 @@ package pipelines
3
3
import (
4
4
"errors"
5
5
"fmt"
6
- "slices"
7
6
"strings"
8
7
8
+ // according to https://freshman.tech/snippets/go/check-if-slice-contains-element
9
+ "golang.org/x/exp/slices"
10
+
9
11
ort "github.com/yalue/onnxruntime_go"
10
12
11
13
util "github.com/knights-analytics/hugot/utils"
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ package util
3
3
import (
4
4
"fmt"
5
5
"math"
6
- "slices"
6
+ "golang.org/x/exp/ slices" // like in tokenClassification.go
7
7
)
8
8
9
9
// Mean of a float32 vector.
You can’t perform that action at this time.
0 commit comments