Allen Park commited on
Commit
4dd4e1f
·
1 Parent(s): d901060

add .to(device) to attention_mask

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -35,7 +35,7 @@ def model_call(question, document, answer):
35
  NEW_FORMAT = PROMPT.format(question=question, document=document, answer=answer)
36
  inputs = tokenizer(NEW_FORMAT, return_tensors="pt")
37
  input_ids = inputs.input_ids.to(device)
38
- attention_mask = inputs.attention_mask
39
  generate_kwargs = dict(
40
  input_ids=input_ids,
41
  do_sample=True,
 
35
  NEW_FORMAT = PROMPT.format(question=question, document=document, answer=answer)
36
  inputs = tokenizer(NEW_FORMAT, return_tensors="pt")
37
  input_ids = inputs.input_ids.to(device)
38
+ attention_mask = inputs.attention_mask.to(device)
39
  generate_kwargs = dict(
40
  input_ids=input_ids,
41
  do_sample=True,