optimum/graphcore/models/t5/modeling_t5.py
def deparallelize(self):
        """
        Undo the changes to the model done by `parallelize`.
        You should call this before doing `save_pretrained` so that the `model.state_dict` is
        fully compatible with `transformers.T5ForConditionalGeneration`.
        """
        # T5ForConditionalGeneration has a deparallelize method, so make sure that the PipelineMixin one is used here.
        PipelineMixin.deparallelize(self)

        self.encoder_and_decoder_embeddings_computation(False)
        # self.scale_down_weights(factor=1, restore=True)

        self.encoder.__class__ = T5Stack
        self.decoder.__class__ = T5Stack

        for mod in self.modules():
            if isinstance(mod, T5LayerNorm):
                mod.forward = T5LayerNorm.forward.__get__(mod, T5LayerNorm)

        return self

        Undo the changes to the model done by `parallelize`.
        You should call this before doing `save_pretrained` so that the `model.state_dict` is
        fully compatible with `transformers.T5ForConditionalGeneration`.
        
Undo the changes to the model done by `parallelize`.
Undo the changes to the model done by ` parallelize ` .
def deparallelize(self):
        PipelineMixin.deparallelize(self)
        self.encoder_and_decoder_embeddings_computation(False)
        self.encoder.__class__ = T5Stack
        self.decoder.__class__ = T5Stack
        for mod in self.modules():
            if isinstance(mod, T5LayerNorm):
                mod.forward = T5LayerNorm.forward.__get__(mod, T5LayerNorm)
        return self
def deparallelize ( self ) : PipelineMixin . deparallelize ( self ) self . encoder_and_decoder_embeddings_computation ( False ) self . encoder . __class__ = T5Stack self . decoder . __class__ = T5Stack for mod in self . modules ( ) : if isinstance ( mod , T5LayerNorm ) : mod . forward = T5LayerNorm . forward . __get__ ( mod , T5LayerNorm ) return self
Undo the changes to the model done by `parallelize`.
Undo the changes to the model done by ` parallelize ` .
"""
        Undo the changes to the model done by `parallelize`.
        You should call this before doing `save_pretrained` so that the `model.state_dict` is
        fully compatible with `transformers.T5ForConditionalGeneration`.
        """ # T5ForConditionalGeneration has a deparallelize method, so make sure that the PipelineMixin one is used here. # self.scale_down_weights(factor=1, restore=True)
self