MCPcopy Create free account
hub / github.com/GCYZSL/MoLA / Stream

Class Stream

utils/callbacks.py:15–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13
14
15class 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
25class Iteratorize:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected