* Fixing #13381 * Enabling automatic LED models.
This commit is contained in:
@@ -105,6 +105,20 @@ class ZeroShotClassificationPipelineTests(unittest.TestCase, metaclass=PipelineT
|
||||
zero_shot_classifier.model.config.label2id = original_label2id
|
||||
self.assertEqual(original_entailment, zero_shot_classifier.entailment_id)
|
||||
|
||||
@require_torch
|
||||
def test_truncation(self):
|
||||
zero_shot_classifier = pipeline(
|
||||
"zero-shot-classification",
|
||||
model="sshleifer/tiny-distilbert-base-cased-distilled-squad",
|
||||
framework="pt",
|
||||
)
|
||||
# There was a regression in 4.10 for this
|
||||
# Adding a test so we don't make the mistake again.
|
||||
# https://github.com/huggingface/transformers/issues/13381#issuecomment-912343499
|
||||
zero_shot_classifier(
|
||||
"Who are you voting for in 2020?" * 100, candidate_labels=["politics", "public health", "science"]
|
||||
)
|
||||
|
||||
@require_torch
|
||||
def test_small_model_pt(self):
|
||||
zero_shot_classifier = pipeline(
|
||||
|
||||
Reference in New Issue
Block a user