Avoid check expected exception when it is on CUDA (#34408)
* update * update --------- Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
@@ -85,8 +85,9 @@ class SummarizationPipelineTests(unittest.TestCase):
|
||||
and len(summarizer.model.trainable_weights) > 0
|
||||
and "GPU" in summarizer.model.trainable_weights[0].device
|
||||
):
|
||||
with self.assertRaises(Exception):
|
||||
outputs = summarizer("This " * 1000)
|
||||
if str(summarizer.device) == "cpu":
|
||||
with self.assertRaises(Exception):
|
||||
outputs = summarizer("This " * 1000)
|
||||
outputs = summarizer("This " * 1000, truncation=TruncationStrategy.ONLY_FIRST)
|
||||
|
||||
@require_torch
|
||||
|
||||
Reference in New Issue
Block a user