MCPcopy Create free account
hub / github.com/modelscope/modelscope / add_stream_generate

Function add_stream_generate

modelscope/utils/streaming_output.py:555–561  ·  view source on GitHub ↗
(model: PreTrainedModel)

Source from the content-addressed store, hash-verified

553
554
555def add_stream_generate(model: PreTrainedModel):
556 pretrained_class = type(model)
557 parent_classes = (pretrained_class, PretrainedModelStreamingOutputMixin)
558 new_model = type(pretrained_class.__name__, parent_classes, {})(
559 model.config)
560 new_model.__dict__.update(model.__dict__)
561 return new_model

Callers 3

__init__Method · 0.90
_init_swiftMethod · 0.90

Calls 1

updateMethod · 0.45

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…