Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
|
|
|
|
| 3 |
|
| 4 |
# Load the pre-trained model and processor
|
| 5 |
model_name = "facebook/s2t-wav2vec2-large-en-ar"
|
|
@@ -18,7 +19,7 @@ def transcribe(audio):
|
|
| 18 |
return transcription
|
| 19 |
|
| 20 |
# Define the Gradio interface
|
| 21 |
-
interface = gr.Interface(fn=transcribe, inputs=gr.Audio(
|
| 22 |
|
| 23 |
# Launch the Gradio interface
|
| 24 |
interface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
|
| 3 |
+
import torch
|
| 4 |
|
| 5 |
# Load the pre-trained model and processor
|
| 6 |
model_name = "facebook/s2t-wav2vec2-large-en-ar"
|
|
|
|
| 19 |
return transcription
|
| 20 |
|
| 21 |
# Define the Gradio interface
|
| 22 |
+
interface = gr.Interface(fn=transcribe, inputs=gr.Audio(type="numpy"), outputs="text")
|
| 23 |
|
| 24 |
# Launch the Gradio interface
|
| 25 |
interface.launch()
|