kdevoe commited on
Commit
08c0006
1 Parent(s): da71a7f

Update inference.py

Browse files
Files changed (1) hide show
  1. inference.py +3 -1
inference.py CHANGED
@@ -28,7 +28,9 @@ def inference(input_text):
28
  tokenizer = torch.load(saved_model_path + 'fine-tuned-tokenizer.pt', map_location=torch.device('cpu'))
29
  model.eval()
30
  input = tokenizer(input_text)
31
- output = model(input['input_ids'], input['attention_mask'])
 
 
32
 
33
  return output.tolist()
34
 
 
28
  tokenizer = torch.load(saved_model_path + 'fine-tuned-tokenizer.pt', map_location=torch.device('cpu'))
29
  model.eval()
30
  input = tokenizer(input_text)
31
+ input_ids = torch.Tensor(input['input_ids']).squeeze(1)
32
+ mask = torch.Tensor(input['attention_mask'])
33
+ output = model(input_ids, mask)
34
 
35
  return output.tolist()
36