cog
cog copied to clipboard
Dont panic if torch version not set
if you try running the comfyui example without a torch version specified you get the following panic:
panic: Invalid major version : strconv.Atoi: parsing "": invalid syntax
goroutine 1 [running]:
github.com/replicate/cog/pkg/util/version.MustVersion({0x0?, 0x0?})
/home/runner/work/cog/cog/pkg/util/version/version.go:56 +0x6b
github.com/replicate/cog/pkg/util/version.Matches({0x0?, 0x0?}, {0xc00034c1d7, 0x5})
/home/runner/work/cog/cog/pkg/util/version/version.go:140 +0x25
github.com/replicate/cog/pkg/config.cudasFromTorch({0x0?, 0x15247dd?})
/home/runner/work/cog/cog/pkg/config/compatibility.go:174 +0x13d
github.com/replicate/cog/pkg/config.(*Config).cudasFromTorch(0xc00047ae80?)
/home/runner/work/cog/cog/pkg/config/config.go:220 +0x38
github.com/replicate/cog/pkg/config.(*Config).validateAndCompleteCUDA(0xc000180af0)
/home/runner/work/cog/cog/pkg/config/config.go:514 +0xb4
github.com/replicate/cog/pkg/config.(*Config).ValidateAndComplete(0xc000180af0, {0xc0005003e0, 0x1b})
/home/runner/work/cog/cog/pkg/config/config.go:339 +0x588
github.com/replicate/cog/pkg/config.GetConfig({0x152875e, 0x8})
/home/runner/work/cog/cog/pkg/config/load.go:31 +0x3e
github.com/replicate/cog/pkg/cli.run(0xc0000fa308, {0xc0000c50e0, 0x1, 0x3})
/home/runner/work/cog/cog/pkg/cli/run.go:65 +0x98
github.com/spf13/cobra.(*Command).execute(0xc0000fa308, {0xc0000c5080, 0x3, 0x3})
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1015 +0xa94
github.com/spf13/cobra.(*Command).ExecuteC(0xc0001d2c08)
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1148 +0x40c
github.com/spf13/cobra.(*Command).Execute(0xc0004a9f40?)
/home/runner/go/pkg/mod/github.com/spf13/[email protected]/command.go:1071 +0x13
main.main()
/home/runner/work/cog/cog/cmd/cog/cog.go:14 +0x66
Cog shouldnt panic and should instead return a helpful error message to the user