code: def hf_model(model_str):
      api = HfApi()
      models = [m.modelId for m in api.list_models()]
      if model_str in models:
          return model_str
      else:
          raise HFModelNotFoundError(model_str)
  
file_path: deepspeed-mii/scripts/model_download.py
imports: import os
  import argparse
  from huggingface_hub import HfApi
  from transformers import AutoConfig, AutoTokenizer, AutoModel
label_desc: Use image node_id 2 for calling a global function with example usage: hf_model(model_str) and returns: model_str