Whisper tflite models for use in Whisper app on F Droid "transcribe translate" models provide signatures for "serving transcribe" and "serving translate" to force the model to perform a certain action @tf.function( input signature=[ tf.TensorSpec((1, 80, 3000), tf.float32, name="input features"), ], ) def transcribe(self, input features): outputs = self.model.generate( input features, max new tokens=450, change as needed return dict in generate=True, forced decoder ids=[[2, 50359], [3, 50363]], forced to transcribe any language with no timestamps ) return {"sequences": outputs["sequences"]} @tf.function( input signature=[ tf.TensorSpec((1, 80, 3000), tf.float32, name="input features"), ], ) def translate(self, input features): outputs = self.model.generate( input features, max new tokens=450, change as needed return dict in generate=True, forced decoder ids=[[2, 50358], [3, 50363]], forced to translate any language with no timestamps ) return {"sequences": outputs["sequences"]} In order to force transcription for a certain language set the 1. decoder id as shown below: def transcribe(self, input features): outputs = self.model.generate( input features, max new tokens=450, change as…
We use cookies for essential functionality and analytics. You can accept or reject analytics cookies.Cookie policy