Spaces:
Runtime error
Runtime error
Upload 2 files
Browse files- app.py +18 -0
- requirements.txt +4 -0
app.py
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
pipe=pipeline("automatic-speech-recognition","distil-whisper/distil-large-v2")
|
8 |
+
|
9 |
+
st.title('speech recognition')
|
10 |
+
wave_audio_data=st_audiorec()
|
11 |
+
if wave_audio_data is None:
|
12 |
+
|
13 |
+
audio_input=st.audio(wave_audio_data,format="audio/wave")
|
14 |
+
|
15 |
+
text=pipe(audio_input)
|
16 |
+
st.write(text)
|
17 |
+
else:
|
18 |
+
st.error('No Audio data')
|
requirements.txt
ADDED
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
torch
|
2 |
+
transformers
|
3 |
+
streamlit
|
4 |
+
streamlit-audiorec
|