def test_error_save_pretrained(self):
        r"""
        The save_pretrained method should raise a ValueError if the model is in BetterTransformer mode.
        All should be good if the model is reversed.
        """
        model_id = "hf-internal-testing/tiny-random-t5"
        model = AutoModelForSeq2SeqLM.from_pretrained(model_id)

        model = model.to_bettertransformer()

        with tempfile.TemporaryDirectory() as tmpdirname:
            with self.assertRaises(ValueError):
                model.save_pretrained(tmpdirname)

            model = model.reverse_bettertransformer()
            model.save_pretrained(tmpdirname)

        The save_pretrained method should raise a ValueError if the model is in BetterTransformer mode.
        All should be good if the model is reversed.
        
dpkd/transformers/tests/bettertransformer/test_integration.py