Spaces:
eaglesarezzo
/
Running on Zero

eaglesarezzo commited on
Commit
9313368
1 Parent(s): c2d1c9a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -6
app.py CHANGED
@@ -27,7 +27,7 @@ cv2.setNumThreads(1)
27
  @spaces.GPU(duration=20)
28
  def respond(
29
  message,
30
- history: list[tuple[str, str]],
31
  model,
32
  system_message,
33
  max_tokens,
@@ -78,11 +78,9 @@ def respond(
78
  messages = BasicChatHistory()
79
 
80
  # add user and assistant messages to the history
81
- for msn in history:
82
- user = {'role': Roles.user, 'content': msn[0]}
83
- assistant = {'role': Roles.assistant, 'content': msn[1]}
84
- messages.add_message(user)
85
- messages.add_message(assistant)
86
 
87
  try:
88
  stream = agent.get_chat_response(
 
27
  @spaces.GPU(duration=20)
28
  def respond(
29
  message,
30
+ history: list[list[str, str]],
31
  model,
32
  system_message,
33
  max_tokens,
 
78
  messages = BasicChatHistory()
79
 
80
  # add user and assistant messages to the history
81
+ for user_msg, assistant_msg in history:
82
+ messages.add_message({'role': Roles.user, 'content': user_msg})
83
+ messages.add_message({'role': Roles.assistant, 'content': assistant_msg})
 
 
84
 
85
  try:
86
  stream = agent.get_chat_response(