sergioska commited on
Commit
25152ca
1 Parent(s): c2293bc

first commit

Browse files
Files changed (2) hide show
  1. app.py +16 -0
  2. requirements.txt +3 -0
app.py ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ import streamlit as st
3
+ import numpy as np
4
+ from PIL import Image, ImageDraw
5
+ from transformers import pipeline
6
+ from tempfile import NamedTemporaryFile
7
+
8
+ audiopipe = pipeline("automatic-speech-recognition", model="openai/whisper-large-v3")st.title('Upload an audio file for speech recognition')
9
+
10
+ uploaded_audio_file = st.file_uploader("Choose an audio file (wav)")
11
+ if uploaded_audio_file is not None:
12
+ with NamedTemporaryFile(suffix="wav") as temp:
13
+ temp.write(uploaded_audio_file.getvalue())
14
+ temp.seek(0)
15
+ result = audiopipe(temp.name)
16
+ st.write(result)
requirements.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ streamlit
2
+ accelerate
3
+ transformers