You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/main.go
+50-1Lines changed: 50 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,7 @@ import (
10
10
"os"
11
11
"path"
12
12
"path/filepath"
13
+
"strings"
13
14
"sync"
14
15
15
16
"github.com/knights-analytics/hugot"
@@ -25,6 +26,7 @@ var outputPath string
25
26
varpipelineTypestring
26
27
varsharedLibraryPathstring
27
28
varbatchSizeint
29
+
varmodelsDirstring
28
30
29
31
varrunCommand=&cli.Command{
30
32
Name: "run",
@@ -34,7 +36,8 @@ var runCommand = &cli.Command{
34
36
ArgsUsage: `
35
37
--input: path to a .jsonl file or a folder with .jsonl files to process. If omitted, the input will be read from stdin.
36
38
--output: path to a folder where to write the output. If omitted, the output will be sent to stdout.
37
-
--model: path to the .onnx model to load.
39
+
--model: model name or path to the .onnx model to load. The hugot cli looks for models with this chain: first use the provided path. If the path does not exist, look for a model
40
+
with this name at $HOME/hugot/models. Finally, try to download the model from Huggingface and use it.
38
41
--type: pipeline type. Currently implemented types are: featureExtraction, tokenClassification, and textClassification (only single label)
39
42
--onnxruntimeSharedLibrary: path to the onnxruntime.so library. If not provided, the cli will try to load it from $HOME/lib/hugot/onnxruntime.so, and from /usr/lib/onnxruntime.so in the last instance.
40
43
`,
@@ -80,11 +83,27 @@ var runCommand = &cli.Command{
80
83
Required: false,
81
84
Value: 20,
82
85
},
86
+
&cli.StringFlag{
87
+
Name: "modelFolder",
88
+
Usage: "Folder where to store downloaded models. Falls back to $HOME/hugot/models if not specified",
0 commit comments