eagle0504 commited on
Commit
4992523
·
verified ·
1 Parent(s): ccd7a75

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +4 -5
src/streamlit_app.py CHANGED
@@ -105,11 +105,6 @@ except KeyError as e:
105
  if "messages" not in st.session_state:
106
  st.session_state.messages = []
107
 
108
- # Display chat messages from history on app rerun
109
- for message in st.session_state.messages:
110
- with st.chat_message(message["role"]):
111
- st.markdown(message["content"])
112
-
113
  with st.sidebar:
114
  instruction = st.selectbox(
115
  "What's the task you want this LLM to do?",
@@ -121,6 +116,10 @@ with st.sidebar:
121
  st.session_state.messages = []
122
  st.rerun()
123
 
 
 
 
 
124
 
125
  # Accept user input
126
  if prompt := st.chat_input("Enter a question based on a selected task."):
 
105
  if "messages" not in st.session_state:
106
  st.session_state.messages = []
107
 
 
 
 
 
 
108
  with st.sidebar:
109
  instruction = st.selectbox(
110
  "What's the task you want this LLM to do?",
 
116
  st.session_state.messages = []
117
  st.rerun()
118
 
119
+ # Display chat messages from history on app rerun
120
+ for message in st.session_state.messages:
121
+ with st.chat_message(message["role"]):
122
+ st.markdown(message["content"])
123
 
124
  # Accept user input
125
  if prompt := st.chat_input("Enter a question based on a selected task."):