AttributeError: st.session_state has no attribute “history”. Did you forget to initialize it?

内容纲要

问题

AttributeError: st.session_state has no attribute "history". Did you forget to initialize it? More info: https://docs.streamlit.io/library/advanced-features/session-state#initialization

原因

启动 streamlit gradio启动方式不对
不能再jupyter notebook中运行 streamlit 代码

解决方案

打开linux terminal命令行,输入以下命令启动相关脚本

streamlit run web_demo_gradio_stream.py
close
arrow_upward