File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 50
50
"trans_impls" : {},
51
51
"required_inputs" : None ,
52
52
"metadata" : None ,
53
+ "target_vocab_populated" : None ,
53
54
}
54
55
55
56
DTYPE_TO_VALUE_KEY = {
@@ -197,7 +198,7 @@ def parse_response_proto(response_proto):
197
198
and estimator ["name" ] in target_vocab_estimators
198
199
and model ["input" ].get ("target_vocab" ) is not None
199
200
):
200
- prediction = model [ "input" ][ "target_vocab " ][int (prediction )]
201
+ prediction = local_cache [ "target_vocab_populated " ][int (prediction )]
201
202
else :
202
203
prediction = util .cast (prediction , target_col_type )
203
204
@@ -400,6 +401,11 @@ def start(args):
400
401
401
402
local_cache ["required_inputs" ] = tf_lib .get_base_input_columns (model ["name" ], ctx )
402
403
404
+ if model ["input" ].get ("target_vocab" ) is not None :
405
+ local_cache ["target_vocab_populated" ] = ctx .populate_values (
406
+ model ["input" ]["target_vocab" ], None , False
407
+ )
408
+
403
409
else :
404
410
if not os .path .isdir (args .model_dir ):
405
411
ctx .storage .download_and_unzip_external (api ["external_model" ]["path" ], args .model_dir )
You can’t perform that action at this time.
0 commit comments