ranamhamoud commited on
Commit
97a0217
·
verified ·
1 Parent(s): 1903e15

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -94,7 +94,7 @@ def generate(
94
  conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
95
  conversation.append({"role": "user", "content": message})
96
 
97
- input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt")
98
  if input_ids.shape[1] > MAX_INPUT_TOKEN_LENGTH:
99
  input_ids = input_ids[:, -MAX_INPUT_TOKEN_LENGTH:]
100
  gr.Warning(f"Trimmed input from conversation as it was longer than {MAX_INPUT_TOKEN_LENGTH} tokens.")
 
94
  conversation.extend([{"role": "user", "content": user}, {"role": "assistant", "content": assistant}])
95
  conversation.append({"role": "user", "content": message})
96
 
97
+ input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt")
98
  if input_ids.shape[1] > MAX_INPUT_TOKEN_LENGTH:
99
  input_ids = input_ids[:, -MAX_INPUT_TOKEN_LENGTH:]
100
  gr.Warning(f"Trimmed input from conversation as it was longer than {MAX_INPUT_TOKEN_LENGTH} tokens.")