# -*- encoding: utf-8 -*- # @Author: SWHL # @Contact: liekkaskono@163.com import streamlit as st from rapid_paraformer import RapidParaformer st.set_option("deprecation.showfileUploaderEncoding", False) config_path = "resources/config.yaml" paraformer = RapidParaformer(config_path) if __name__ == "__main__": st.markdown( "

RapidASR

", unsafe_allow_html=True, ) st.markdown( """

PyPI SemVer2.0

""", unsafe_allow_html=True, ) video_file = st.file_uploader(label="Upload a file", type=['wav']) if video_file: audio_bytes = video_file.read() st.markdown('#### Raw video:') save_path = '1.wav' st.audio(audio_bytes, format='audio/mp3') with open(save_path, 'wb') as f: f.write(audio_bytes) with st.spinner('正在识别中...'): result = paraformer(save_path) st.markdown("#### ASR Result:") st.write(result)