dinhdat1110 commited on
Commit
95b6c1d
·
1 Parent(s): 588fda0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -15,6 +15,9 @@ def chat_history(history) -> str:
15
  for i, message in enumerate(dialog):
16
  role = "user" if i % 2 == 0 else "assistant"
17
  messages.append({"role": role, "content": message})
 
 
 
18
  return pipe.tokenizer.apply_chat_template(
19
  messages, tokenize=False, add_generation_prompt=True
20
  )
 
15
  for i, message in enumerate(dialog):
16
  role = "user" if i % 2 == 0 else "assistant"
17
  messages.append({"role": role, "content": message})
18
+
19
+ messages.pop(-1)
20
+
21
  return pipe.tokenizer.apply_chat_template(
22
  messages, tokenize=False, add_generation_prompt=True
23
  )