File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
pkg/operator/api/userconfig Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -63,8 +63,9 @@ var apiValidation = &cr.StructValidation{
6363 {
6464 StructField : "ModelFormat" ,
6565 StringValidation : & cr.StringValidation {
66- Required : true ,
67- AllowedValues : ModelFormatStrings (),
66+ Required : false ,
67+ AllowEmpty : true ,
68+ AllowedValues : append (ModelFormatStrings (), "" ),
6869 },
6970 Parser : func (str string ) (interface {}, error ) {
7071 return ModelFormatFromString (str ), nil
@@ -115,7 +116,13 @@ func (apis APIs) Validate() error {
115116}
116117
117118func (api * API ) Validate () error {
118- if ! yaml .StartsWithEscapedAtSymbol (api .Model ) {
119+ if yaml .StartsWithEscapedAtSymbol (api .Model ) {
120+ api .ModelFormat = TensorFlowModelFormat
121+ } else {
122+ if api .ModelFormat == UnknownModelFormat {
123+ return errors .Wrap (cr .ErrorMustBeDefined (), Identify (api ), ModelFormatKey )
124+ }
125+
119126 if ! aws .IsValidS3Path (api .Model ) {
120127 return errors .Wrap (ErrorInvalidS3PathOrResourceReference (api .Model ), Identify (api ), ModelKey )
121128 }
You can’t perform that action at this time.
0 commit comments