Spaces:
Sleeping
Sleeping
File size: 1,815 Bytes
7c3f2d7 a78c6ca baa78d9 426aa59 baa78d9 7c3f2d7 baa78d9 426aa59 baa78d9 426aa59 baa78d9 426aa59 baa78d9 426aa59 a78c6ca |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
import streamlit as st
import subprocess
def run_makefile():
result = subprocess.run(["make"], capture_output=True, text=True)
if result.returncode == 0:
st.success(f"Makefile executed successfully:\n{result.stdout}")
else:
st.error(f"Makefile execution failed:\n{result.stderr}")
st.title("Run Makefile")
if st.button("Run Makefile"):
run_makefile()
'''import streamlit as st
import time
import soundfile as sf
from whisper_processor import process_audio
def process_audio_streamlit(audio_file, model_name, lang):
start_time = time.time()
# Read audio data
audio, sample_rate = sf.read(audio_file)
# Check if conversion is necessary
if sample_rate != 16000:
# Resample to 16kHz
audio = sf.resample(audio, sample_rate, 16000)
# Save the resampled audio (optional)
# sf.write("temp_resampled.wav", audio, 16000)
# Process the audio with Whisper
result = process_audio(audio, model_name=model_name, lang=lang)
end_time = time.time()
elapsed_time = end_time - start_time
st.write("Time taken:", elapsed_time, "seconds")
return result
st.title("Audio Transcription")
# Upload audio file
uploaded_file = st.file_uploader("Choose an audio file")
# Select model and language
model_name = st.selectbox("Select model", ["tiny", "base", "small", "medium", "large"])
lang = st.selectbox("Select language", ["en", "hi", "fr", "de", "es", "it", "pt", "ru", "zh", "ja", "ko", "ar", "tr"])
if uploaded_file is not None:
# Save the uploaded file to a temporary location
with open("temp.wav", "wb") as f:
f.write(uploaded_file.read())
# Process the audio file
result = process_audio_streamlit("temp.wav", model_name, lang)
# Display the transcription result
st.write("Transcription:")
st.text_area("", value=result, height=300)''' |