MCPcopy Create free account
hub / github.com/huggingface/evaluate / DummyTextClassificationPipeline

Class DummyTextClassificationPipeline

tests/test_evaluator.py:71–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69
70
71class DummyTextClassificationPipeline:
72 def __init__(self, sleep_time=None):
73 self.task = "text-classification"
74 self.sleep_time = sleep_time
75
76 def __call__(self, inputs, **kwargs):
77 if self.sleep_time is not None:
78 sleep(self.sleep_time)
79 return [{"label": "NEGATIVE"} if i % 2 == 1 else {"label": "POSITIVE"} for i, _ in enumerate(inputs)]
80
81
82class DummyImageClassificationPipeline:

Callers 3

setUpMethod · 0.90
setUpMethod · 0.85
setUpMethod · 0.85

Calls

no outgoing calls

Tested by 3

setUpMethod · 0.72
setUpMethod · 0.68
setUpMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…