brdhaker3 commited on
Commit
54bcda0
·
verified ·
1 Parent(s): 1b28cd2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -13
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
- description = ''' This is a Tunisian ASR based on WavLM Model, fine-tuned on a dataset of 2.5 Hours resulting in a WER of 24%.
 
 
111
  \n
112
- \n Interesting isn\'t it !'''
113
-
114
- gr.Interface(
115
- fn=treat_wav_file,
116
- inputs=[
117
- gr.Audio(sources="microphone", type='filepath', label="Record"),
118
- gr.Audio(sources="upload", type='filepath', label="Upload File")
119
- ],
120
- outputs="text",
121
- title=title,
122
- description=description
123
- ).launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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()