Spaces:
Sleeping
Sleeping
Commit ·
6e67a0c
1
Parent(s): bb3e3ae
added sliding window
Browse files178 unmodified lines17918018118218218418518318418515 unmodified lines201202203204205206207208209210211212178 unmodified lines
st.session_state.inference_time.append(tock - tick) len_response = 0
st.session_state["tokens_used"] = len_response + \ st.session_state["tokens_used"]
formatted_links = ", ".join(links) with st.chat_message("assistant"):15 unmodified lines placeholder.markdown(full_response + "▌") placeholder.markdown(full_response) len_response = (len(prompt.split()) + len(full_response.split())) * 1.25 st.session_state["tokens_used"] = len_response + st.session_state["tokens_used"]
if st.session_state["tokens_used"] > 15000 : st.session_state.history = st.session_state.history[-3:] st.session_state.history.append([prompt, full_response]) st.session_state.history.append(identity_change) app.py+5-3