Generating transcriptions in the side pane! Please wait...
", unsafe_allow_html=True)): with st.spinner("Generating transcriptions in the side pane! Please wait..."): transcription = speechtoText(temp_filename) emo = predict(audio_array,ser_model,2,tokenizer,transcription) # Display the transcription in a textbox st.sidebar.text_area("Transcription", transcription, height=25) except: st.write("Inference impossible, a problem occurred with your audio or your parameters, we apologize :(") txt = f"You seem to be {(emo2promptMapping[emo]).capitalize()}!\n Click on 'Show Helpful Tips' button to proceed further." st.markdown(f"Generating tips (it may take upto 2-3 mins). Please wait...
", unsafe_allow_html=True)): with st.spinner("Generating transcriptions in the side pane! Please wait..."): # Retrieve prompt from the emotion emo = st.session_state.emo # Call the function for GENAI temp=0.9 top_k=50 top_p=0.8 GenerateText(emo,gpt_tokenizer,gpt_model,temp,top_k,top_p) if st.button(button_label2): with st.spinner(st.markdown("Generating tips (it may take upto 2-3 mins). Please wait...
", unsafe_allow_html=True)): # Retrieve prompt from the emotion emo = st.session_state.emo temp=0.2 top_k=90 top_p=0.95 # Call the function for GENAI GenerateText(emo,gpt_tokenizer,gpt_model,temp,top_k,top_p) def main(): """ Main function for running a Streamlit-based multi-modal text generation application. This function configures the Streamlit application, loads necessary models and tokenizers, and allows users to process audio files to generate transcriptions and helpful tips. Returns: None """ config() if st.sidebar.button("**Open External Audio Recorder!**"): open_page("https://voice-recorder-online.com/") # Load the models, and tokenizers ser_model,tokenizer,gpt_model,gpt_tokenizer = load_model() # Process and analyze uploaded audio files process_file(ser_model,tokenizer,gpt_model,gpt_tokenizer) if __name__ == '__main__': main()