Skip to content

Commit 98bca62

Browse files
committed
Upgrade Onnxruntime, OpenXLA and Go versions
1 parent aa731a3 commit 98bca62

File tree

9 files changed

+29
-29
lines changed

9 files changed

+29
-29
lines changed

.github/workflows/release.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Set up Go
2727
uses: actions/setup-go@v2
2828
with:
29-
go-version: '1.23.3'
29+
go-version: '1.24.3'
3030
- name: Checkout code
3131
uses: actions/checkout@v4
3232
- name: Install dependencies

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Set up Go
1717
uses: actions/setup-go@v2
1818
with:
19-
go-version: '1.23.3'
19+
go-version: '1.24.3'
2020
- name: Checkout code
2121
uses: actions/checkout@v4
2222
- name: Install dependencies

.golangci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
linters:
2-
disable-all: true
32
enable:
43
# Check for pass []any as any in variadic func(...any).
54
# Rare case but saved me from debugging a few times.
@@ -129,4 +128,5 @@ linters:
129128
- usestdlibvars
130129

131130
# Finds wasted assignment statements.
132-
- wastedassign
131+
- wastedassign
132+
version: "2"

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#--- dockerfile to test hugot ---
22

33
ARG GO_VERSION=1.24.3
4-
ARG ONNXRUNTIME_VERSION=1.21.0
4+
ARG ONNXRUNTIME_VERSION=1.22.0
55
ARG BUILD_PLATFORM=linux/amd64
66

77
#--- runtime layer with all hugot dependencies for cpu ---

README.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
## What
1010

11+
TL;DR: AI use-cases such as embeddings, text classification, named entity recognition, fine-tuning, and more!
12+
1113
The goal of this library is to provide an easy, scalable, and hassle-free way to run transformer pipelines inference and training in golang applications, such as Hugging Face 🤗 transformers pipelines. It is built on the following principles:
1214

1315
1. Hugging Face compatibility: models trained and tested using the python huggingface transformer library can be exported to onnx and used with the hugot pipelines to obtain identical predictions as in the python version.
@@ -17,17 +19,19 @@ The goal of this library is to provide an easy, scalable, and hassle-free way to
1719

1820
We support inference on CPU and on all accelerators supported by ONNX Runtime/OpenXLA. Note however that currently only CPU, and GPU inference on Nvidia GPUs via CUDA, are tested (see below).
1921

22+
Hugot loads and saves models in the ONNX format.
23+
2024
## Why
2125

22-
Developing and fine-tuning transformer models with the Hugging Face python library is a great experience, but if your production stack is golang-based being able to reliably deploy and scale the resulting pytorch models can be challenging and can require quite some setup. This library aims to allow you to just lift-and-shift your python model and use the same Hugging Face pipelines you use for development for inference in a go application.
26+
Developing and fine-tuning transformer models with the Hugging Face python library is great, but if your production stack is golang-based being able to reliably deploy and scale the resulting pytorch models can be challenging. This library aims to allow you to just lift-and-shift your python model and use the same Hugging Face pipelines you use for development for inference in a go application.
2327

2428
## For whom
2529

2630
For the golang developer or ML engineer who wants to run or fine-tune transformer pipelines on their own hardware and tightly coupled with their own application, without having to deal with writing their own inference or training code.
2731

2832
## By whom
2933

30-
Hugot is brought to you by the friendly folks at [Knights Analytics](https://knightsanalytics.com), who use Hugot in production to automate ai-powered decision intelligence.
34+
Hugot is brought to you by the friendly folks at [Knights Analytics](https://knightsanalytics.com), who use Hugot in production to automate ai-powered data curation.
3135

3236
## Implemented pipelines
3337

@@ -238,7 +242,7 @@ We is currently supported only for the **FeatureExtractionPipeline**. This can b
238242
{"sentence1": "The quick brown fox jumps over the lazy dog", "sentence2": "A quick brown cow jumps over a lazy caterpillar", "score": 0.5}
239243
```
240244
241-
See the [example](./testData/sts-train.jsonl) for a sample dataset.
245+
See the [example](./testData/semanticSimilarityTest.jsonl) for a sample dataset.
242246
243247
The score is assumed to be a float between 0 and 1 that encodes the semantic similarity between the sentences, and by default a cosine similarity loss is used (see [sentence transformers](https://sbert.net/docs/package_reference/sentence_transformer/losses.html#cosinesimilarityloss)). However, you can also specify a different loss function from `goMLX` using the `XLATrainingOptions` field in the `TrainingConfig` struct. See [the training tests](./hugot_training_test.go) for examples on how to train or fine-tune feature extraction pipelines.
244248

cuda.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#--- dockerfile to test hugot ---
22

33
ARG GO_VERSION=1.24.3
4-
ARG ONNXRUNTIME_VERSION=1.21.0
4+
ARG ONNXRUNTIME_VERSION=1.22.0
55
ARG BUILD_PLATFORM=linux/amd64
66

77
#--- runtime layer with all hugot dependencies for cpu and gpu ---

go.mod

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
module github.com/knights-analytics/hugot
22

3-
go 1.23.3
3+
go 1.24
44

55
require (
66
github.com/daulet/tokenizers v1.20.2
77
github.com/gomlx/exceptions v0.0.3
88
github.com/gomlx/go-huggingface v0.2.0
9-
github.com/gomlx/gomlx v0.19.2
10-
github.com/gomlx/gopjrt v0.7.0
11-
github.com/gomlx/onnx-gomlx v0.2.1
9+
github.com/gomlx/gomlx v0.19.4
10+
github.com/gomlx/gopjrt v0.7.1
11+
github.com/gomlx/onnx-gomlx v0.2.2
1212
github.com/json-iterator/go v1.1.12
1313
github.com/mattn/go-isatty v0.0.20
1414
github.com/stretchr/testify v1.10.0
1515
github.com/urfave/cli/v2 v2.27.6
1616
github.com/viant/afs v1.26.2
17-
github.com/yalue/onnxruntime_go v1.19.0
17+
github.com/yalue/onnxruntime_go v1.19.1-0.20250521134902-f70a71e4f522
1818
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6
1919
)
2020

2121
require (
22-
github.com/cpuguy83/go-md2man/v2 v2.0.6 // indirect
22+
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
2323
github.com/davecgh/go-spew v1.1.1 // indirect
2424
github.com/dustin/go-humanize v1.0.1 // indirect
2525
github.com/go-errors/errors v1.5.1 // indirect

go.sum

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0=
2-
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
1+
github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo=
2+
github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
33
github.com/daulet/tokenizers v1.20.2 h1:tlq/vIOiBTKDPets3596aFvmJYLn3XI6LFKq4q9LKhQ=
44
github.com/daulet/tokenizers v1.20.2/go.mod h1:tGnMdZthXdcWY6DGD07IygpwJqiPvG85FQUnhs/wSCs=
55
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -17,12 +17,12 @@ github.com/gomlx/exceptions v0.0.3 h1:HKnTgEjj4jlmhr8zVFkTP9qmV1ey7ypYYosQ8GzXWu
1717
github.com/gomlx/exceptions v0.0.3/go.mod h1:uHL0TQwJ0xaV2/snJOJV6hSE4yRmhhfymuYgNredGxU=
1818
github.com/gomlx/go-huggingface v0.2.0 h1:qEWqZ7eYwwSqJk7Y5g9bYKf6qRTu8CRWFQCT79NvM70=
1919
github.com/gomlx/go-huggingface v0.2.0/go.mod h1:pSI9KFkGVksYYnNNO5lqLPBR0hzboFQb2FGrpGjseIY=
20-
github.com/gomlx/gomlx v0.19.2 h1:iK8DtMU91Kgc9ez9fu2xBnfozsjkaCXVfJuMz3UvjEI=
21-
github.com/gomlx/gomlx v0.19.2/go.mod h1:RdhIh7sixw3HWFevfiM7DOPu2SAATjKcOzBI/ZV7Inc=
22-
github.com/gomlx/gopjrt v0.7.0 h1:7TwlK+mRGTkqQYHemxwzIPGGIG9Q8fN7GnmqRspRMHY=
23-
github.com/gomlx/gopjrt v0.7.0/go.mod h1:HJn0wemLuFPxHr7P7zvuiloLR2OsLv60HV/4obxTXVc=
24-
github.com/gomlx/onnx-gomlx v0.2.1 h1:n7LHC+dFRi2pZeyOIK7nAUM+Gmh1oPOdruSm6wUhbtk=
25-
github.com/gomlx/onnx-gomlx v0.2.1/go.mod h1:2vcxuS5NJ2zbNBFGBYxR59aRydIzBZw6a10FCY1kjGY=
20+
github.com/gomlx/gomlx v0.19.4 h1:71I3VeBS00IUUBZcE9mZxmMx65qL7O3CtumaHK6ghp0=
21+
github.com/gomlx/gomlx v0.19.4/go.mod h1:6zkDUqqdEl16DgoVZrTaEH643gf3wvQFAknnGgFQXOE=
22+
github.com/gomlx/gopjrt v0.7.1 h1:OGZbMN7CCn2dU+CDr65InDO0XPmrC5NUnJ9STXa/lXE=
23+
github.com/gomlx/gopjrt v0.7.1/go.mod h1:VswjttDY1uSllQ+Vs69P4kgsH3EkFEHADUCdDbfgh0Y=
24+
github.com/gomlx/onnx-gomlx v0.2.2 h1:D5HqzRiaAcPscj/tgVY9jG33jdcKo00AL4BB2mIVoi4=
25+
github.com/gomlx/onnx-gomlx v0.2.2/go.mod h1:T1HIeH7sXQOmi2ZkIfc0pjBglTkDBBeXMeF0vHjTPKk=
2626
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
2727
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
2828
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
@@ -65,8 +65,8 @@ github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
6565
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
6666
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
6767
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
68-
github.com/yalue/onnxruntime_go v1.19.0 h1:+qCu7/Nzrr/TY7B3sMy9sOATegP2qbtXn4b7q90fDOo=
69-
github.com/yalue/onnxruntime_go v1.19.0/go.mod h1:b4X26A8pekNb1ACJ58wAXgNKeUCGEAQ9dmACut9Sm/4=
68+
github.com/yalue/onnxruntime_go v1.19.1-0.20250521134902-f70a71e4f522 h1:rpmBrqsPv6Wcsg/LIU0dIbdMn5QPv+TNoDqFNwWttEc=
69+
github.com/yalue/onnxruntime_go v1.19.1-0.20250521134902-f70a71e4f522/go.mod h1:b4X26A8pekNb1ACJ58wAXgNKeUCGEAQ9dmACut9Sm/4=
7070
golang.org/x/crypto v0.38.0 h1:jt+WWG8IZlBnVbomuhg2Mdq0+BBQaHbtqHEFEigjUV8=
7171
golang.org/x/crypto v0.38.0/go.mod h1:MvrbAqul58NNYPKnOra203SB9vpuZW0e+RRZV+Ggqjw=
7272
golang.org/x/exp v0.0.0-20250506013437-ce4c2cf36ca6 h1:y5zboxd6LQAqYIhHnB48p0ByQ/GnQx2BE33L8BOHQkI=

util/file.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,3 @@ func NewFileWriter(filename string, contentType string) (io.WriteCloser, error)
121121
}
122122
return fileSystem.NewWriter(context.Background(), filename, 0644, option.NewSkipChecksum(true))
123123
}
124-
125-
func MoveFile(from string, to string) error {
126-
return fileSystem.Move(context.Background(), from, to, option.NewSource(option.NewStream(partSize, 0)), option.NewDest(option.NewSkipChecksum(true)))
127-
}

0 commit comments

Comments
 (0)