Skip to content

Commit

Permalink
test valid hypothesis
Browse files Browse the repository at this point in the history
  • Loading branch information
sambhavnoobcoder committed Jan 25, 2025
1 parent a4eb2a4 commit 0189b43
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_zero_shot_classification_handler.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
import pytest
from transformers.pipelines import ZeroShotClassificationArgumentHandler

def test_valid_hypothesis_template():
handler = ZeroShotClassificationArgumentHandler()
sequences = ["I love this movie"]
labels = ["positive", "negative"]
template = "This movie is {}."

# Should work fine with simple template
sequence_pairs, _ = handler(sequences, labels, template)
assert len(sequence_pairs) == 2
assert sequence_pairs[0][1] == "This movie is positive."

0 comments on commit 0189b43

Please sign in to comment.