[tests] add the missing require_sacremoses decorator (#29504)
* add sacremoses check * fix style * for FlaubertTokenizer * HerbertTokenizer fix * add typeHint * Update src/transformers/testing_utils.py Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com> * make less skipped * make quality * remove import --------- Co-authored-by: amyeroberts <22614925+amyeroberts@users.noreply.github.com>
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
import math
|
||||
import unittest
|
||||
|
||||
from transformers import BioGptConfig, is_torch_available
|
||||
from transformers import BioGptConfig, is_sacremoses_available, is_torch_available
|
||||
from transformers.testing_utils import require_torch, slow, torch_device
|
||||
|
||||
from ...generation.test_utils import GenerationTesterMixin
|
||||
@@ -294,7 +294,7 @@ class BioGptModelTest(ModelTesterMixin, GenerationTesterMixin, PipelineTesterMix
|
||||
"token-classification": BioGptForTokenClassification,
|
||||
"zero-shot": BioGptForSequenceClassification,
|
||||
}
|
||||
if is_torch_available()
|
||||
if is_torch_available() and is_sacremoses_available()
|
||||
else {}
|
||||
)
|
||||
test_pruning = False
|
||||
|
||||
@@ -19,11 +19,12 @@ import os
|
||||
import unittest
|
||||
|
||||
from transformers.models.biogpt.tokenization_biogpt import VOCAB_FILES_NAMES, BioGptTokenizer
|
||||
from transformers.testing_utils import slow
|
||||
from transformers.testing_utils import require_sacremoses, slow
|
||||
|
||||
from ...test_tokenization_common import TokenizerTesterMixin
|
||||
|
||||
|
||||
@require_sacremoses
|
||||
class BioGptTokenizationTest(TokenizerTesterMixin, unittest.TestCase):
|
||||
tokenizer_class = BioGptTokenizer
|
||||
test_rust_tokenizer = False
|
||||
|
||||
Reference in New Issue
Block a user