docstr: This test checks that we'll first download h5 weights before safetensors
  The safetensors file on that repo is a pt safetensors and therefore cannot be loaded without PyTorch
docstr_tok: ["This","test","checks","that","we","'ll","first","download","h5","weights","before","safetensors","The","safetensors","file","on","that","repo","is","a","pt","safetensors","and","therefore","can","not","be","loaded","without","PyTorch"]
code: def test_safetensors_load_from_local_h5_before_safetensors(self):
      """
      This test checks that we'll first download h5 weights before safetensors
      The safetensors file on that repo is a pt safetensors and therefore cannot be loaded without PyTorch
      """
      with tempfile.TemporaryDirectory() as tmp:
          location = snapshot_download(
              "hf-internal-testing/tiny-bert-pt-safetensors-msgpack",
              cache_dir=tmp,
          )
          TFBertModel.from_pretrained(location)
  
imports: from __future__ import annotations
  import inspect
  import json
  import os
  import random
  import tempfile
  import unittest
  import unittest.mock
  from huggingface_hub import HfFolder, Repository, delete_repo, snapshot_download
  from huggingface_hub.file_download import http_get
  from requests.exceptions import HTTPError
  from transformers import is_tf_available, is_torch_available
  from transformers.configuration_utils import PretrainedConfig
  from transformers.testing_utils import TOKEN, USER, CaptureLogger, _tf_gpu_memory_limit, is_pt_tf_cross_test, is_staging_test, require_safetensors, require_tf, require_torch, slow
  from transformers.utils import SAFE_WEIGHTS_NAME, TF2_WEIGHTS_INDEX_NAME, TF2_WEIGHTS_NAME, logging
label_desc: Use image node_id 27 for calling the TFModelUtilsTest obj's underlying member method code with example usage: obj.test_safetensors_load_from_local_h5_before_safetensors() without return types