Spaces:
Runtime error
Runtime error
Commit
·
54dc27b
1
Parent(s):
f46c081
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,13 @@
|
|
1 |
from transformers import pipeline
|
2 |
import gradio as gr
|
3 |
import time
|
4 |
-
|
5 |
p = pipeline("automatic-speech-recognition",model="kingabzpro/wav2vec2-large-xls-r-300m-Urdu")
|
6 |
|
7 |
def transcribe(audio, state=""):
|
8 |
time.sleep(2)
|
9 |
text = p(audio)["text"]
|
10 |
-
state += text + " "
|
11 |
return state, state
|
12 |
|
13 |
################### Gradio Web APP ################################
|
|
|
1 |
from transformers import pipeline
|
2 |
import gradio as gr
|
3 |
import time
|
4 |
+
import unicodedata
|
5 |
p = pipeline("automatic-speech-recognition",model="kingabzpro/wav2vec2-large-xls-r-300m-Urdu")
|
6 |
|
7 |
def transcribe(audio, state=""):
|
8 |
time.sleep(2)
|
9 |
text = p(audio)["text"]
|
10 |
+
state += unicodedata.normalize("NFC",text) + " "
|
11 |
return state, state
|
12 |
|
13 |
################### Gradio Web APP ################################
|