Skip to content

Commit

Permalink
Fix zero-shot pipeline single seq output shape (#6104)
Browse files Browse the repository at this point in the history
  • Loading branch information
joeddav authored Jul 28, 2020
1 parent 06834bc commit b1c8b76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/pipelines.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,7 +959,7 @@ def __call__(self, sequences, candidate_labels, hypothesis_template="This exampl
top_inds = list(reversed(scores[iseq].argsort()))
result.append(
{
"sequence": sequences if num_sequences == 1 else sequences[iseq],
"sequence": sequences if isinstance(sequences, str) else sequences[iseq],
"labels": [candidate_labels[i] for i in top_inds],
"scores": scores[iseq][top_inds].tolist(),
}
Expand Down

0 comments on commit b1c8b76

Please sign in to comment.