artificialguybr commited on
Commit
bfe7113
·
1 Parent(s): a48985f

Refactor chat history format

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -101,6 +101,7 @@ with gr.Blocks() as demo:
101
  print("Updating chatbot...")
102
  chat_history = user(message, chat_history)
103
  chat_history, _, _ = chat(chat_history, system_msg.value, max_tokens.value, temperature.value, top_p.value, 40, 1.1)
 
104
  return chat_history, chat_history, ""
105
 
106
  submit.click(
 
101
  print("Updating chatbot...")
102
  chat_history = user(message, chat_history)
103
  chat_history, _, _ = chat(chat_history, system_msg.value, max_tokens.value, temperature.value, top_p.value, 40, 1.1)
104
+ chat_history = [(msg["role"], msg["content"]) for msg in chat_history]
105
  return chat_history, chat_history, ""
106
 
107
  submit.click(