Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
|
@@ -45,7 +45,7 @@ def Hindi(audio):
|
|
| 45 |
transcriber = pipeline("automatic-speech-recognition", model="theainerd/Wav2Vec2-large-xlsr-hindi")
|
| 46 |
sr, y = audio
|
| 47 |
y = y.astype(np.float32)
|
| 48 |
-
y
|
| 49 |
|
| 50 |
text = transcriber({"sampling_rate":sr, "raw":y})["text"]
|
| 51 |
|
|
@@ -57,7 +57,7 @@ def Telegu(audio):
|
|
| 57 |
transcriber = pipeline("automatic-speech-recognition", model="anuragshas/wav2vec2-large-xlsr-53-telugu")
|
| 58 |
sr, y = audio
|
| 59 |
y = y.astype(np.float32)
|
| 60 |
-
y
|
| 61 |
|
| 62 |
text = transcriber({"sampling_rate":sr, "raw":y})["text"]
|
| 63 |
|
|
@@ -68,7 +68,7 @@ def Tamil(audio):
|
|
| 68 |
transcriber = pipeline("automatic-speech-recognition", model="Harveenchadha/vakyansh-wav2vec2-tamil-tam-250")
|
| 69 |
sr, y = audio
|
| 70 |
y = y.astype(np.float32)
|
| 71 |
-
y
|
| 72 |
|
| 73 |
text = transcriber({"sampling_rate":sr, "raw":y})["text"]
|
| 74 |
|
|
@@ -79,7 +79,7 @@ def Kannada(audio):
|
|
| 79 |
transcriber = pipeline("automatic-speech-recognition", model="vasista22/whisper-kannada-medium")
|
| 80 |
sr, y = audio
|
| 81 |
y = y.astype(np.float32)
|
| 82 |
-
y
|
| 83 |
|
| 84 |
text = transcriber({"sampling_rate":sr, "raw":y})["text"]
|
| 85 |
|
|
@@ -142,8 +142,7 @@ demo = gr.Interface(
|
|
| 142 |
)],
|
| 143 |
"text",
|
| 144 |
title = "Farmers-Helper-Bot",
|
| 145 |
-
description = "Ask your queries in your regional Language"
|
| 146 |
-
theme=gr.themes.Soft()
|
| 147 |
)
|
| 148 |
|
| 149 |
demo.launch(share=True)
|
|
|
|
| 45 |
transcriber = pipeline("automatic-speech-recognition", model="theainerd/Wav2Vec2-large-xlsr-hindi")
|
| 46 |
sr, y = audio
|
| 47 |
y = y.astype(np.float32)
|
| 48 |
+
y /= np.max(np.abs(y))
|
| 49 |
|
| 50 |
text = transcriber({"sampling_rate":sr, "raw":y})["text"]
|
| 51 |
|
|
|
|
| 57 |
transcriber = pipeline("automatic-speech-recognition", model="anuragshas/wav2vec2-large-xlsr-53-telugu")
|
| 58 |
sr, y = audio
|
| 59 |
y = y.astype(np.float32)
|
| 60 |
+
y /= np.max(np.abs(y))
|
| 61 |
|
| 62 |
text = transcriber({"sampling_rate":sr, "raw":y})["text"]
|
| 63 |
|
|
|
|
| 68 |
transcriber = pipeline("automatic-speech-recognition", model="Harveenchadha/vakyansh-wav2vec2-tamil-tam-250")
|
| 69 |
sr, y = audio
|
| 70 |
y = y.astype(np.float32)
|
| 71 |
+
y /= np.max(np.abs(y))
|
| 72 |
|
| 73 |
text = transcriber({"sampling_rate":sr, "raw":y})["text"]
|
| 74 |
|
|
|
|
| 79 |
transcriber = pipeline("automatic-speech-recognition", model="vasista22/whisper-kannada-medium")
|
| 80 |
sr, y = audio
|
| 81 |
y = y.astype(np.float32)
|
| 82 |
+
y /= np.max(np.abs(y))
|
| 83 |
|
| 84 |
text = transcriber({"sampling_rate":sr, "raw":y})["text"]
|
| 85 |
|
|
|
|
| 142 |
)],
|
| 143 |
"text",
|
| 144 |
title = "Farmers-Helper-Bot",
|
| 145 |
+
description = "Ask your queries in your regional Language"
|
|
|
|
| 146 |
)
|
| 147 |
|
| 148 |
demo.launch(share=True)
|