Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,6 +3,7 @@ import wikipedia
|
|
3 |
os.system("pip install git+https://github.com/openai/whisper.git")
|
4 |
import gradio as gr
|
5 |
import whisper
|
|
|
6 |
|
7 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
8 |
|
@@ -23,6 +24,9 @@ def inference(audio):
|
|
23 |
options = whisper.DecodingOptions(fp16 = False)
|
24 |
result = whisper.decode(model, mel, options)
|
25 |
|
|
|
|
|
|
|
26 |
print(result.text)
|
27 |
print(passage)
|
28 |
return result.text, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
|
|
3 |
os.system("pip install git+https://github.com/openai/whisper.git")
|
4 |
import gradio as gr
|
5 |
import whisper
|
6 |
+
from jiwer import wer
|
7 |
|
8 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
9 |
|
|
|
24 |
options = whisper.DecodingOptions(fp16 = False)
|
25 |
result = whisper.decode(model, mel, options)
|
26 |
|
27 |
+
error = wer(passage, result.text)
|
28 |
+
print(f"WER is {error}")
|
29 |
+
|
30 |
print(result.text)
|
31 |
print(passage)
|
32 |
return result.text, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|