Update app.py
Browse files
app.py
CHANGED
@@ -5,20 +5,15 @@ import os
|
|
5 |
|
6 |
pipe = pipeline(task="automatic-speech-recognition", model="geokanaan/Whisper_Base_Lebanese_Arabizi")
|
7 |
def transcribe(audio):
|
8 |
-
|
9 |
-
|
10 |
-
y /= np.max(np.abs(y))
|
11 |
|
12 |
-
|
13 |
-
|
14 |
-
HF_TOKEN = os.getenv('WRITE')
|
15 |
#hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN, "geokanaan/flagged_Audio_Lebanese")
|
16 |
|
17 |
iface = gr.Interface(
|
18 |
fn=transcribe,
|
19 |
-
inputs=
|
20 |
-
gr.Audio(sources="microphone")
|
21 |
-
],
|
22 |
outputs="text",
|
23 |
title="arabeasy",
|
24 |
description="Realtime demo for Lebanese Arabizi speech recognition",
|
|
|
5 |
|
6 |
pipe = pipeline(task="automatic-speech-recognition", model="geokanaan/Whisper_Base_Lebanese_Arabizi")
|
7 |
def transcribe(audio):
|
8 |
+
text = pipe(audio)["text"]
|
9 |
+
return text
|
|
|
10 |
|
11 |
+
#HF_TOKEN = os.getenv('WRITE')
|
|
|
|
|
12 |
#hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN, "geokanaan/flagged_Audio_Lebanese")
|
13 |
|
14 |
iface = gr.Interface(
|
15 |
fn=transcribe,
|
16 |
+
inputs=gr.Audio(sources="microphone",type = 'filepath'),
|
|
|
|
|
17 |
outputs="text",
|
18 |
title="arabeasy",
|
19 |
description="Realtime demo for Lebanese Arabizi speech recognition",
|