code: def test_create_model_invalid_hf_hub_model_id(
      mock_urlopen,
      json_load,
      sagemaker_session,
  ):
      expected_url = (
          f"https://huggingface.co/{HF_MODEL_ID}/raw/main/config.json"
      )
      with pytest.raises(ValueError) as invalid_model_id:
          cm = MagicMock()
          cm.__enter__.return_value = cm
          mock_urlopen.return_value = cm
          json_load.side_effect = JSONDecodeError("", "", 0)
          _ = DJLModel(
              HF_MODEL_ID,
              ROLE,
              sagemaker_session=sagemaker_session,
              number_of_partitions=4,
          )
          mock_urlopen.assert_any_call(expected_url)
      assert str(invalid_model_id.value).startswith(
          "Did not find a config.json or model_index.json file in huggingface hub"
      )
  
imports: from __future__ import absolute_import
  import logging
  import json
  from json import JSONDecodeError
  import pytest
  from mock import Mock, MagicMock
  from mock import patch, mock_open
  from sagemaker.djl_inference import defaults, DJLModel, DJLPredictor, HuggingFaceAccelerateModel, DeepSpeedModel
  from sagemaker.djl_inference.model import DJLServingEngineEntryPointDefaults
  from sagemaker.s3_utils import s3_path_join
  from sagemaker.session_settings import SessionSettings
  from tests.unit import _test_default_bucket_and_prefix_combinations, DEFAULT_S3_BUCKET_NAME, DEFAULT_S3_OBJECT_KEY_PREFIX_NAME
label_desc: Use image node_id 4 for calling a global function with example usage: test_create_model_invalid_hf_hub_model_id(mock_urlopen, json_load, sagemaker_session) without return types