Download st_reset_conversation.py from allinaigc/coder001: direct link, hf CLI and curl.
- Browser
- Download file 437 Bytes
-
https://huggingface.co/spaces/allinaigc/coder001/resolve/main/st_reset_conversation.py
- Command line
-
hf download hf://spaces/allinaigc/coder001/st_reset_conversation.py
-
curl -L -o st_reset_conversation.py https://huggingface.co/spaces/allinaigc/coder001/resolve/main/st_reset_conversation.py
437 Bytes
| ## reset all conversion inside streamlit | |
| ## clear conversion. | |
| import streamlit as st | |
| def reset_all(): | |
| # st.session_state.conversation = None ## 关闭这个可以保持当前的模型选项? | |
| st.session_state.chat_history = None | |
| st.session_state.messages = [] | |
| message_placeholder = st.empty() | |
| return None | |
| def reset_message(): | |
| st.session_state.messages = [] | |
| message_placeholder = st.empty() | |
| return None | |