From 6b0ccfeba14dc226164bae2a8b3ea7042cb047c3 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Wed, 9 Aug 2023 22:14:28 +0000 Subject: [PATCH] support for -e in cog predict Signed-off-by: Jesse Andrews --- pkg/cli/predict.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/cli/predict.go b/pkg/cli/predict.go index d4e8dec674..519930f079 100644 --- a/pkg/cli/predict.go +++ b/pkg/cli/predict.go @@ -24,6 +24,7 @@ import ( ) var ( + envFlags []string inputFlags []string outPath string ) @@ -49,6 +50,7 @@ the prediction on that.`, cmd.Flags().StringArrayVarP(&inputFlags, "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 path=@image.jpg") cmd.Flags().StringVarP(&outPath, "output", "o", "", "Output path") + cmd.Flags().StringArrayVarP(&envFlags, "env", "e", []string{}, "Environment variables, in the form name=value") return cmd } @@ -110,6 +112,7 @@ func cmdPredict(cmd *cobra.Command, args []string) error { GPUs: gpus, Image: imageName, Volumes: volumes, + Env: envFlags, }) go func() {