Skip to content

Commit 993cb36

Browse files
committed
attempt to downgrade go to v1.20
1 parent 2e6c78b commit 993cb36

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ require (
3232
github.com/russross/blackfriday/v2 v2.1.0 // indirect
3333
github.com/xrash/smetrics v0.0.0-20240312152122-5f08fbb34913 // indirect
3434
golang.org/x/crypto v0.22.0 // indirect
35+
golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f // indirect
3536
golang.org/x/oauth2 v0.19.0 // indirect
3637
golang.org/x/sys v0.19.0 // indirect
3738
gopkg.in/yaml.v3 v3.0.1 // indirect

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ github.com/yalue/onnxruntime_go v1.9.0 h1:AhgkpBjphJZsHT5karKt93xPkPFNP0Iz6ENUbN
5656
github.com/yalue/onnxruntime_go v1.9.0/go.mod h1:b4X26A8pekNb1ACJ58wAXgNKeUCGEAQ9dmACut9Sm/4=
5757
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=
5858
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=
5961
golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4=
6062
golang.org/x/oauth2 v0.19.0 h1:9+E/EZBCbTLNrbN35fHv/a/d/mOBatymz1zbtQrXpIg=
6163
golang.org/x/oauth2 v0.19.0/go.mod h1:vYi7skDa1x015PmRRYZ7+s1cWyPgrPiSYRe4rnsexc8=

hugot.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"context"
55
"errors"
66
"fmt"
7-
"slices"
87

98
util "github.com/knights-analytics/hugot/utils"
109

@@ -34,7 +33,7 @@ func (m pipelineMap[T]) Destroy() error {
3433
func (m pipelineMap[T]) GetStats() []string {
3534
var stats []string
3635
for _, p := range m {
37-
stats = slices.Concat(stats, p.GetStats())
36+
stats = append(stats, p.GetStats()...)
3837
}
3938
return stats
4039
}
@@ -299,9 +298,10 @@ func (s *Session) Destroy() error {
299298
// the number of batch calls to the onnxruntime inference
300299
// the average time per onnxruntime inference batch call
301300
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(),
303303
s.textClassificationPipelines.GetStats(),
304-
s.featureExtractionPipelines.GetStats(),
304+
s.featureExtractionPipelines.GetStats()...
305305
)
306306
}
307307

pipelines/tokenClassification.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ package pipelines
33
import (
44
"errors"
55
"fmt"
6-
"slices"
76
"strings"
87

8+
// according to https://freshman.tech/snippets/go/check-if-slice-contains-element
9+
"golang.org/x/exp/slices"
10+
911
ort "github.com/yalue/onnxruntime_go"
1012

1113
util "github.com/knights-analytics/hugot/utils"

utils/vectors.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package util
33
import (
44
"fmt"
55
"math"
6-
"slices"
6+
"golang.org/x/exp/slices" // like in tokenClassification.go
77
)
88

99
// Mean of a float32 vector.

0 commit comments

Comments
 (0)