Spaces:
Runtime error
Runtime error
Commit
·
71c9f80
1
Parent(s):
2b6fc4a
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,11 +13,11 @@ if __name__ == '__main__':
|
|
| 13 |
tf_out = model(speech, training=False)
|
| 14 |
return tf.squeeze(tf.argmax(tf_out, axis=-1))
|
| 15 |
|
| 16 |
-
def
|
| 17 |
_, speech = inputs
|
| 18 |
speech = tf.constant(speech, dtype=tf.float32)
|
| 19 |
speech = tf.transpose(speech)
|
| 20 |
tf_out = _forward(speech)
|
| 21 |
return tokenizer.decode(tf_out.numpy().tolist())
|
| 22 |
|
| 23 |
-
gr.Interface(fn=
|
|
|
|
| 13 |
tf_out = model(speech, training=False)
|
| 14 |
return tf.squeeze(tf.argmax(tf_out, axis=-1))
|
| 15 |
|
| 16 |
+
def transcribe_text(inputs):
|
| 17 |
_, speech = inputs
|
| 18 |
speech = tf.constant(speech, dtype=tf.float32)
|
| 19 |
speech = tf.transpose(speech)
|
| 20 |
tf_out = _forward(speech)
|
| 21 |
return tokenizer.decode(tf_out.numpy().tolist())
|
| 22 |
|
| 23 |
+
gr.Interface(fn=transcribe_text, inputs="audio", outputs="text").launch()
|