alex4cip Claude commited on
Commit
aa3c1df
·
1 Parent(s): ab64ed7

fix: Change truncate to truncation in tokenizer.encode()

Browse files

TypeError: PreTrainedTokenizerFast._batch_encode_plus() got an unexpected keyword argument 'truncate'

🔧 Fix:
- Change 'truncate=True' to 'truncation=True'
- Correct parameter name for Transformers library
- Fixes tokenization error during inference

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -85,7 +85,7 @@ def generate_response(message, history):
85
  inputs = current_tokenizer.encode(
86
  conversation,
87
  return_tensors="pt",
88
- truncate=True,
89
  max_length=512,
90
  ).to('cuda')
91
 
 
85
  inputs = current_tokenizer.encode(
86
  conversation,
87
  return_tensors="pt",
88
+ truncation=True,
89
  max_length=512,
90
  ).to('cuda')
91