| 13 | |
| 14 | |
| 15 | class Stream(transformers.StoppingCriteria): |
| 16 | def __init__(self, callback_func=None): |
| 17 | self.callback_func = callback_func |
| 18 | |
| 19 | def __call__(self, input_ids, scores) -> bool: |
| 20 | if self.callback_func is not None: |
| 21 | self.callback_func(input_ids[0]) |
| 22 | return False |
| 23 | |
| 24 | |
| 25 | class Iteratorize: |
nothing calls this directly
no outgoing calls
no test coverage detected