letao670982 commited on
Commit
006cec6
·
verified ·
1 Parent(s): 423f2ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -0
app.py CHANGED
@@ -54,6 +54,7 @@ def generate(
54
  conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
55
  conversation.append({"role": "user", "content": message})
56
 
 
57
  input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt", add_generation_prompt=True)
58
  if input_ids.shape[1] > MAX_INPUT_TOKEN_LENGTH:
59
  input_ids = input_ids[:, -MAX_INPUT_TOKEN_LENGTH:]
 
54
  conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
55
  conversation.append({"role": "user", "content": message})
56
 
57
+ print("conversation: ", conversation)
58
  input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt", add_generation_prompt=True)
59
  if input_ids.shape[1] > MAX_INPUT_TOKEN_LENGTH:
60
  input_ids = input_ids[:, -MAX_INPUT_TOKEN_LENGTH:]