Update app.py
Browse files
app.py
CHANGED
@@ -106,18 +106,37 @@ def treat_wav_file(file_mic, file_upload, asr=asr_brain, device="cpu"):
|
|
106 |
|
107 |
#Gradio interface
|
108 |
import gradio as gr
|
|
|
109 |
title = "Tunisian Speech Recognition"
|
110 |
-
|
|
|
|
|
111 |
\n
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
|
107 |
#Gradio interface
|
108 |
import gradio as gr
|
109 |
+
|
110 |
title = "Tunisian Speech Recognition"
|
111 |
+
|
112 |
+
description = '''
|
113 |
+
This is a Tunisian ASR based on the **WavLM Model**, fine-tuned on a dataset of **2.5 hours**, resulting in a **W.E.R of 24%** and a **C.E.R of 9%**.
|
114 |
\n
|
115 |
+
Interested? Try it out!
|
116 |
+
'''
|
117 |
+
|
118 |
+
disclaimer = '''
|
119 |
+
> ⚠️ **Disclaimer:**
|
120 |
+
> This is a **demo model**, and transcription accuracy is limited due to Hugging Face model storage constraints.
|
121 |
+
> For better performance, can run the full model locally.
|
122 |
+
> Check out the repository and follow the instructions: [LINK](https://huggingface.co/brdhaker3/TunASR)
|
123 |
+
'''
|
124 |
+
|
125 |
+
with gr.Blocks() as demo:
|
126 |
+
gr.Markdown(f"# {title}")
|
127 |
+
gr.Markdown(description)
|
128 |
+
gr.Markdown(disclaimer)
|
129 |
+
|
130 |
+
interface = gr.Interface(
|
131 |
+
fn=treat_wav_file,
|
132 |
+
inputs=[
|
133 |
+
gr.Audio(sources="microphone", type='filepath', label="Record"),
|
134 |
+
gr.Audio(sources="upload", type='filepath', label="Upload File")
|
135 |
+
],
|
136 |
+
outputs="text",
|
137 |
+
title="",
|
138 |
+
description=""
|
139 |
+
)
|
140 |
+
|
141 |
+
|
142 |
+
demo.launch()
|