Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,8 @@
|
|
1 |
import torch
|
2 |
-
from torch import *
|
3 |
from transformers import pipeline
|
4 |
import streamlit as st
|
5 |
from st_audiorec import st_audiorec
|
6 |
-
|
7 |
def make_text(audio):
|
8 |
pipe=pipeline("automatic-speech-recognition","distil-whisper/distil-large-v2")
|
9 |
text= pipe(audio)
|
@@ -14,8 +13,8 @@ st.title('speech recognition')
|
|
14 |
wave_audio_data=st_audiorec()
|
15 |
if wave_audio_data is not None:
|
16 |
|
17 |
-
|
18 |
-
text=make_text(
|
19 |
|
20 |
st.write(text)
|
21 |
else:
|
|
|
1 |
import torch
|
|
|
2 |
from transformers import pipeline
|
3 |
import streamlit as st
|
4 |
from st_audiorec import st_audiorec
|
5 |
+
@st.cache
|
6 |
def make_text(audio):
|
7 |
pipe=pipeline("automatic-speech-recognition","distil-whisper/distil-large-v2")
|
8 |
text= pipe(audio)
|
|
|
13 |
wave_audio_data=st_audiorec()
|
14 |
if wave_audio_data is not None:
|
15 |
|
16 |
+
|
17 |
+
text=make_text(wave_audio_data)
|
18 |
|
19 |
st.write(text)
|
20 |
else:
|