Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -117,7 +117,9 @@ def transcribe(Microphone, File_Upload):
|
|
| 117 |
pred_ids = torch.argmax(logits, dim=-1)
|
| 118 |
transcription = processor.decode(pred_ids[0])
|
| 119 |
|
| 120 |
-
|
|
|
|
|
|
|
| 121 |
|
| 122 |
|
| 123 |
examples=['sample1.mp3', 'sample2.mp3', 'sample3.mp3']
|
|
@@ -142,10 +144,11 @@ gr.Interface(
|
|
| 142 |
],
|
| 143 |
|
| 144 |
outputs=[
|
|
|
|
| 145 |
gr.outputs.Textbox(label="Language"),
|
| 146 |
gr.Number(label="Probability"),
|
| 147 |
],
|
| 148 |
-
|
| 149 |
verbose=True,
|
| 150 |
examples = examples,
|
| 151 |
title="Language Identification from Audio",
|
|
|
|
| 117 |
pred_ids = torch.argmax(logits, dim=-1)
|
| 118 |
transcription = processor.decode(pred_ids[0])
|
| 119 |
|
| 120 |
+
language, probability = detect_language(transcription)
|
| 121 |
+
|
| 122 |
+
return transcription.capitalize(), language, probability
|
| 123 |
|
| 124 |
|
| 125 |
examples=['sample1.mp3', 'sample2.mp3', 'sample3.mp3']
|
|
|
|
| 144 |
],
|
| 145 |
|
| 146 |
outputs=[
|
| 147 |
+
gr.outputs.Textbox(label="Transcription"),
|
| 148 |
gr.outputs.Textbox(label="Language"),
|
| 149 |
gr.Number(label="Probability"),
|
| 150 |
],
|
| 151 |
+
|
| 152 |
verbose=True,
|
| 153 |
examples = examples,
|
| 154 |
title="Language Identification from Audio",
|