docstr: This test checks that we cannot load safetensors from a checkpoint that only has safetensors
  saved in the "pt" format if torch isn't installed.
docstr_tok: ["This","test","checks","that","we","can","not","load","safetensors","from","a","checkpoint","that","only","has","safetensors","saved","in","the","``","pt","''","format","if","torch","is","n't","installed","."]
code: def test_safetensors_load_from_local_from_safetensors_pt_without_torch_installed(
      self,
  ):
      """
      This test checks that we cannot load safetensors from a checkpoint that only has safetensors
      saved in the "pt" format if torch isn't installed.
      """
      if is_torch_available():
          # This test verifies that a correct error message is shown when loading from a pt safetensors
          # PyTorch shouldn't be installed for this to work correctly.
          return
  
      with tempfile.TemporaryDirectory() as tmp:
          location = snapshot_download(
              "hf-internal-testing/tiny-bert-pt-safetensors",
              cache_dir=tmp,
          )
  
          # Cannot load from the PyTorch-formatted checkpoint without PyTorch installed
          with self.assertRaises(ModuleNotFoundError):
              _ = FlaxBertModel.from_pretrained(location)
  
imports: import tempfile
  import unittest
  import numpy
  from huggingface_hub import HfFolder, delete_repo, snapshot_download
  from requests.exceptions import HTTPError
  from transformers import BertConfig, BertModel, is_flax_available, is_torch_available
  from transformers.testing_utils import TOKEN, USER, is_pt_flax_cross_test, is_staging_test, require_flax, require_safetensors, require_torch
  from transformers.utils import FLAX_WEIGHTS_NAME, SAFE_WEIGHTS_NAME
label_desc: Use image node_id 12 for calling the FlaxModelUtilsTest obj's underlying member method code with example usage: obj.test_safetensors_load_from_local_from_safetensors_pt_without_torch_installed() without return types