def METHOD_NAME(work: ServeStreamlit) -> None:
    import streamlit as st
    # Build the model (once per session, equivalent to gradio when enable_queue is Flase)
    if "_model" not in st.session_state:
        with st.spinner("Building model..."):
            st.session_state["_model"] = work.build_model()
    work._model = st.session_state["_model"]