@@ -257,7 +257,7 @@ def recognize(self, signals):
257257 """
258258 def execute (signal : tf .Tensor ):
259259 features = self .speech_featurizer .tf_extract (signal )
260- encoded , _ = self .encoder_inference (features , self .encoder .get_initial_states ())
260+ encoded , _ = self .encoder_inference (features , self .encoder .get_initial_state ())
261261 hypothesis = self .perform_greedy (
262262 encoded ,
263263 predicted = tf .constant (self .text_featurizer .blank , dtype = tf .int32 ),
@@ -310,10 +310,13 @@ def recognize_beam(self, signals, lm=False):
310310 """
311311 def execute (signal : tf .Tensor ):
312312 features = self .speech_featurizer .tf_extract (signal )
313- encoded , _ = self .encoder_inference (features , self .encoder .get_initial_states ())
313+ encoded , _ = self .encoder_inference (features , self .encoder .get_initial_state ())
314314 hypothesis = self .perform_beam_search (encoded , lm )
315- prediction = tf .map_fn (lambda x : tf .strings .to_number (x , tf .int32 ),
316- tf .strings .split (hypothesis .prediction ), fn_output_signature = tf .TensorSpec ([], dtype = tf .int32 ))
315+ prediction = tf .map_fn (
316+ lambda x : tf .strings .to_number (x , tf .int32 ),
317+ tf .strings .split (hypothesis .prediction ),
318+ fn_output_signature = tf .TensorSpec ([], dtype = tf .int32 )
319+ )
317320 transcripts = self .text_featurizer .iextract (tf .expand_dims (prediction , axis = 0 ))
318321 return tf .squeeze (transcripts ) # reshape from [1] to []
319322
0 commit comments