ahmed-masry commited on
Commit
20daea3
·
verified ·
1 Parent(s): e3112e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -59,7 +59,7 @@ def generate(
59
  conversation.append({"role": "user", "content": message})
60
 
61
  inputs = tokenizer.apply_chat_template(conversation, tokenize=False)
62
- inputs = tokenizer(inputs, return_tensors='pt', return_token_type_ids=False)
63
 
64
  # input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt")
65
  if input_ids.shape[1] > MAX_INPUT_TOKEN_LENGTH:
 
59
  conversation.append({"role": "user", "content": message})
60
 
61
  inputs = tokenizer.apply_chat_template(conversation, tokenize=False)
62
+ input_ids = tokenizer(inputs, return_tensors='pt', return_token_type_ids=False).input_ids
63
 
64
  # input_ids = tokenizer.apply_chat_template(conversation, return_tensors="pt")
65
  if input_ids.shape[1] > MAX_INPUT_TOKEN_LENGTH: