fehmikaya commited on
Commit
500ab7d
·
verified ·
1 Parent(s): d9936eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -79,15 +79,15 @@ temperature = st.sidebar.slider("Temperature", 0.0, 1.0, 0.7, 0.1)
79
  max_new_tokens = st.sidebar.number_input("Max New Tokens", 50, 500, 256, step=50)
80
  top_p = st.sidebar.slider("Top P", 0.1, 1.0, 0.9, 0.1)
81
 
82
- if "messages" not in st.session_state:
83
- st.session_state.messages = [{"role": "system", "content": system_prompt}]
84
-
85
  system_prompt = st.sidebar.text_area(
86
  "System Prompt",
87
  "You are a food critic Chatbot. Reply in the style of a New York Times food critic",
88
  key="system_prompt", on_change=prompt_changed, args=("system_prompt")
89
  )
90
 
 
 
 
91
  for message in st.session_state.messages[1:]:
92
  with st.chat_message(message['role'], avatar=icons[message['role']]):
93
  st.write(message['content'])
 
79
  max_new_tokens = st.sidebar.number_input("Max New Tokens", 50, 500, 256, step=50)
80
  top_p = st.sidebar.slider("Top P", 0.1, 1.0, 0.9, 0.1)
81
 
 
 
 
82
  system_prompt = st.sidebar.text_area(
83
  "System Prompt",
84
  "You are a food critic Chatbot. Reply in the style of a New York Times food critic",
85
  key="system_prompt", on_change=prompt_changed, args=("system_prompt")
86
  )
87
 
88
+ if "messages" not in st.session_state:
89
+ st.session_state.messages = [{"role": "system", "content": system_prompt}]
90
+
91
  for message in st.session_state.messages[1:]:
92
  with st.chat_message(message['role'], avatar=icons[message['role']]):
93
  st.write(message['content'])