utar commited on
Commit
5a4b85a
·
1 Parent(s): de9bf37

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -196,12 +196,11 @@ stop = False
196
  st.title("Chatbot Demo")
197
 
198
  with st.container():
199
- assistant_role_name = st.text_input("User-AI", value="Singapore Tourism Board")
200
- user_role_name = st.text_input("Assistant-AI", value="Tourist that has never been to Singapore")
201
  task = st.text_input("Task", value="Discuss the best tourist attractions to see in Singapore")
202
  word_limit = st.slider("Word limit", min_value=0, max_value=50, value=15)
203
  chat_turn_limit = st.slider("Max. Messages", min_value=0, max_value=30, value=10)
204
- specified_task_container = st.empty()
205
 
206
  with st.container():
207
  chat_container = st.empty()
@@ -216,7 +215,7 @@ with st.container():
216
  if gen_button:
217
  specified_task = get_specified_task(assistant_role_name, user_role_name, task, word_limit)
218
  with chat_container.container():
219
- st.write(f"Task: {specified_task}")
220
 
221
  if stop_button:
222
  stop = True
@@ -224,7 +223,7 @@ if stop_button:
224
 
225
  if init_button:
226
  # Initialize agents
227
- assistant_sys_msg, user_sys_msg = get_sys_msgs(assistant_role_name, user_role_name, specified_task)
228
  assistant_agent = CAMELAgent(assistant_sys_msg, ChatOpenAI(temperature=0.2))
229
  user_agent = CAMELAgent(user_sys_msg, ChatOpenAI(temperature=0.2))
230
 
 
196
  st.title("Chatbot Demo")
197
 
198
  with st.container():
199
+ assistant_role_name = st.text_input("Assistant-AI", value="Singapore Tourism Board")
200
+ user_role_name = st.text_input("User-AI", value="Tourist that has never been to Singapore")
201
  task = st.text_input("Task", value="Discuss the best tourist attractions to see in Singapore")
202
  word_limit = st.slider("Word limit", min_value=0, max_value=50, value=15)
203
  chat_turn_limit = st.slider("Max. Messages", min_value=0, max_value=30, value=10)
 
204
 
205
  with st.container():
206
  chat_container = st.empty()
 
215
  if gen_button:
216
  specified_task = get_specified_task(assistant_role_name, user_role_name, task, word_limit)
217
  with chat_container.container():
218
+ task = st.text_input("Task", value=specified_task)
219
 
220
  if stop_button:
221
  stop = True
 
223
 
224
  if init_button:
225
  # Initialize agents
226
+ assistant_sys_msg, user_sys_msg = get_sys_msgs(assistant_role_name, user_role_name, task)
227
  assistant_agent = CAMELAgent(assistant_sys_msg, ChatOpenAI(temperature=0.2))
228
  user_agent = CAMELAgent(user_sys_msg, ChatOpenAI(temperature=0.2))
229