Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,9 +3,15 @@ from transformers import pipeline
|
|
3 |
import streamlit as st
|
4 |
from st_audiorec import st_audiorec
|
5 |
@st.cache_resource
|
6 |
-
def
|
7 |
pipe=pipeline("automatic-speech-recognition","distil-whisper/distil-large-v2")
|
8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
extract_text=text['text']
|
10 |
return extract_text
|
11 |
|
|
|
3 |
import streamlit as st
|
4 |
from st_audiorec import st_audiorec
|
5 |
@st.cache_resource
|
6 |
+
def load_model():
|
7 |
pipe=pipeline("automatic-speech-recognition","distil-whisper/distil-large-v2")
|
8 |
+
return pipe
|
9 |
+
|
10 |
+
speech_to_text_model=load_model()
|
11 |
+
|
12 |
+
def make_text(audio):
|
13 |
+
global speech_to_text_model
|
14 |
+
text= speech_to_text_model(audio)
|
15 |
extract_text=text['text']
|
16 |
return extract_text
|
17 |
|