def test_safetensors_load_from_local_from_safetensors_pt(self):
        """
        This test checks that we can load safetensors from a local checkpoint that only has those
        saved in the "pt" format.
        """
        with tempfile.TemporaryDirectory() as tmp:
            location = snapshot_download("hf-internal-testing/tiny-bert-h5", cache_dir=tmp)
            tf_model = TFBertModel.from_pretrained(location)

        # Can load from the PyTorch-formatted checkpoint
        with tempfile.TemporaryDirectory() as tmp:
            location = snapshot_download("hf-internal-testing/tiny-bert-pt-safetensors", cache_dir=tmp)
            safetensors_model = TFBertModel.from_pretrained(location)

        for p1, p2 in zip(tf_model.weights, safetensors_model.weights):
            self.assertTrue(np.allclose(p1.numpy(), p2.numpy()))

        This test checks that we can load safetensors from a local checkpoint that only has those
        saved in the "pt" format.
        
dpkd/transformers/tests/test_modeling_tf_utils.py