import copy import streamlit as st from src.tunnel import start_server from src.generation import FIXED_GENERATION_CONFIG, load_model from src.pages import DEFAULT_DIALOGUE_STATES, sidebar_fragment, specify_audio_fragment, conversation_section st.set_page_config(page_title='MERaLiON-AudioLLM', page_icon = "🔥", layout='wide') st.markdown('', unsafe_allow_html=True) if "server" not in st.session_state: st.session_state.server = start_server() if "client" not in st.session_state or 'model_name' not in st.session_state: st.session_state.client, st.session_state.model_name = load_model() for key, value in FIXED_GENERATION_CONFIG.items(): if key not in st.session_state: st.session_state[key]=copy.deepcopy(value) for key, value in DEFAULT_DIALOGUE_STATES.items(): if key not in st.session_state: st.session_state[key]=copy.deepcopy(value) with st.sidebar: sidebar_fragment() if st.sidebar.button('Clear History'): st.session_state.update(copy.deepcopy(DEFAULT_DIALOGUE_STATES)) st.markdown("