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: pkg/cli/train.go
+52-20Lines changed: 52 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,7 @@
1
1
package cli
2
2
3
3
import (
4
+
"fmt"
4
5
"os"
5
6
"os/signal"
6
7
"syscall"
@@ -15,16 +16,21 @@ import (
15
16
)
16
17
17
18
var (
19
+
trainEnvFlags []string
18
20
trainInputFlags []string
21
+
trainOutPathstring
19
22
)
20
23
21
24
funcnewTrainCommand() *cobra.Command {
22
25
cmd:=&cobra.Command{
23
-
Use: "train",
26
+
Use: "train [image]",
24
27
Short: "Run a training",
25
28
Long: `Run a training.
26
29
27
-
It will build the model in the current directory and train it.`,
30
+
If 'image' is passed, it will run the training on that Docker image.
31
+
It must be an image that has been built by Cog.
32
+
33
+
Otherwise, it will build the model in the current directory and train it.`,
28
34
RunE: cmdTrain,
29
35
Args: cobra.MaximumNArgs(1),
30
36
Hidden: true,
@@ -33,37 +39,62 @@ It will build the model in the current directory and train it.`,
33
39
addBuildProgressOutputFlag(cmd)
34
40
addDockerfileFlag(cmd)
35
41
addUseCudaBaseImageFlag(cmd)
42
+
addGpusFlag(cmd)
36
43
37
44
cmd.Flags().StringArrayVarP(&trainInputFlags, "input", "i", []string{}, "Inputs, in the form name=value. if value is prefixed with @, then it is read from a file on disk. E.g. -i [email protected]")
0 commit comments