allyyy commited on
Commit
0aef0fe
·
verified ·
1 Parent(s): c8a6eb8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -61,7 +61,7 @@ def generate_response(user_query, relevant_segment):
61
  input_ids = tokenizer.encode(user_message, return_tensors='pt')
62
 
63
  # Create attention mask (1 for real tokens, 0 for padding tokens)
64
- attention_mask = (input_ids != tokenizer.pad_token_id).to(torch.long)
65
 
66
  # Generate the response using the model
67
  output = model.generate(
 
61
  input_ids = tokenizer.encode(user_message, return_tensors='pt')
62
 
63
  # Create attention mask (1 for real tokens, 0 for padding tokens)
64
+ attention_mask = (input_ids != tokenizer.pad_token_id).long()
65
 
66
  # Generate the response using the model
67
  output = model.generate(