Fix typos in tests (#36547)

Signed-off-by: co63oc <co63oc@users.noreply.github.com>
This commit is contained in:
co63oc
2025-03-06 07:04:06 +08:00
committed by GitHub
parent 752ef3fd4e
commit 996f512d52
99 changed files with 282 additions and 282 deletions

View File

@@ -251,7 +251,7 @@ class CommonPipelineTest(unittest.TestCase):
self.assertTrue(model.generation_config.num_beams == 1)
# Under the hood: we now store a generation config in the pipeline. This generation config stores the
# task-specific paremeters.
# task-specific parameters.
self.assertTrue(pipe.generation_config.num_beams == 4)
# We can confirm that the task-specific parameters have an effect. (In this case, the default is `num_beams=1`,

View File

@@ -147,7 +147,7 @@ class DocumentQuestionAnsweringPipelineTests(unittest.TestCase):
outputs = dqa_pipeline(image=image, question=question, top_k=2)
self.assertEqual(outputs, [])
# We can optionnally pass directly the words and bounding boxes
# We can optionally pass directly the words and bounding boxes
image = "./tests/fixtures/tests_samples/COCO/000000039769.png"
words = []
boxes = []
@@ -183,7 +183,7 @@ class DocumentQuestionAnsweringPipelineTests(unittest.TestCase):
outputs = dqa_pipeline(image=image, question=question, top_k=2)
self.assertEqual(outputs, [])
# We can optionnally pass directly the words and bounding boxes
# We can optionally pass directly the words and bounding boxes
image = "./tests/fixtures/tests_samples/COCO/000000039769.png"
words = []
boxes = []

View File

@@ -196,7 +196,7 @@ class FeatureExtractionPipelineTests(unittest.TestCase):
elif model.config.is_encoder_decoder:
self.skipTest(
"""encoder_decoder models are trickier for this pipeline.
Do we want encoder + decoder inputs to get some featues?
Do we want encoder + decoder inputs to get some features?
Do we want encoder only features ?
For now ignore those.
"""

View File

@@ -177,7 +177,7 @@ class ImageFeatureExtractionPipelineTests(unittest.TestCase):
elif model.config.is_encoder_decoder:
self.skipTest(
"""encoder_decoder models are trickier for this pipeline.
Do we want encoder + decoder inputs to get some featues?
Do we want encoder + decoder inputs to get some features?
Do we want encoder only features ?
For now ignore those.
"""

View File

@@ -347,7 +347,7 @@ class QAPipelineTests(unittest.TestCase):
" Yes Bank a loss of ₹ 1,800 crore by extending credit facilities to Avantha Group, when it was"
" not eligible for the same"
),
"question": "Is this person invovled in fraud?",
"question": "Is this person involved in fraud?",
}
)
self.assertEqual(

View File

@@ -109,7 +109,7 @@ class TextClassificationPipelineTests(unittest.TestCase):
)
# Do not apply any function to output for regression tasks
# hack: changing problem_type artifically (so keep this test at last)
# hack: changing problem_type artificially (so keep this test at last)
text_classifier.model.config.problem_type = "regression"
outputs = text_classifier("This is great !")
self.assertEqual(nested_simplify(outputs), [{"label": "LABEL_0", "score": 0.01}])

View File

@@ -500,7 +500,7 @@ class TextGenerationPipelineTests(unittest.TestCase):
with self.assertRaises(ValueError):
outputs = text_generator("test", return_text=True, return_tensors=True)
# Empty prompt is slighly special
# Empty prompt is slightly special
# it requires BOS token to exist.
# Special case for Pegasus which will always append EOS so will
# work even without BOS.
@@ -637,7 +637,7 @@ class TextGenerationPipelineTests(unittest.TestCase):
logger = logging.get_logger("transformers.generation.tf_utils")
else:
logger = logging.get_logger("transformers.generation.utils")
logger_msg = "Both `max_new_tokens`" # The beggining of the message to be checked in this test
logger_msg = "Both `max_new_tokens`" # The beginning of the message to be checked in this test
# Both are set by the user -> log warning
with CaptureLogger(logger) as cl: