Skip to content

Commit

Permalink
[aisingapore#61] Bug fix CPU if no_cuda
Browse files Browse the repository at this point in the history
  • Loading branch information
ktyap committed Nov 9, 2022
1 parent bab0ffd commit 353e4c5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sgnlp/models/dialogue_rnn/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def eval_model(model, dataloader, no_cuda=False):

preprocessor = DialogueRNNPreprocessor(model.transformer_model_family,
model.model,
model.tokenizer)
model.tokenizer,
no_cuda)

for conversations, label, loss_mask, speaker_mask in tqdm(dataloader, leave=False):

Expand All @@ -46,7 +47,7 @@ def eval_model(model, dataloader, no_cuda=False):
labels_ = label.view(-1)

# obtain log probabilities
output = model(features, lengths, umask, qmask)
output = model(features, lengths, umask, qmask, None, None, None, no_cuda)
pred_ = output.prediction

preds.append(pred_.data.cpu().numpy())
Expand Down

0 comments on commit 353e4c5

Please sign in to comment.