class_docstr: Abstract class offering interface which should be implemented by all NeMo models.
class_docstr_tok: ["Abstract","class","offering","interface","which","should","be","implemented","by","all","NeMo","models","."]
docstr: Resolve the HuggingFace Hub model pretrained information given a model name.
  The model name must be of general syntax ``{source_repo}/{model_name}``.
  
  Note:
      The ``{source_repo}`` need not be ``nvidia``, it can be any public repository, even external to Nvidia.
      This allows public, externally contributed models to be run freely using Nvidia NeMo.
  
  Args:
      model_name: Str name of the model. Must be the original name or an alias of the model, without any '/'.
      refresh_cache: Bool, determines whether cache must be refreshed (model is re-downloaded).
  
  Returns:
      A tuple of details describing :
      -   The resolved class of the model. Since the source is external to NeMo, always default to using
          the calling class. Depend on target class resolution by restore_from() for calling the correct class.
      -   The path to the NeMo model (.nemo file) in some cached directory (managed by HF Hub).
docstr_tok: ["Resolve","the","HuggingFace","Hub","model","pretrained","information","given","a","model","name",".","The","model","name","must","be","of","general","syntax","``","{","source_repo","}","\/","{","model_name","}","``",".","Note",":","The","``","{","source_repo","}","``","need","not","be","``","nvidia","``",",","it","can","be","any","public","repository",",","even","external","to","Nvidia",".","This","allows","public",",","externally","contributed","models","to","be","run","freely","using","Nvidia","NeMo",".","Args",":","model_name",":","Str","name","of","the","model",".","Must","be","the","original","name","or","an","alias","of","the","model",",","without","any","'\/","'",".","refresh_cache",":","Bool",",","determines","whether","cache","must","be","refreshed","(","model","is","re-downloaded",")",".","Returns",":","A","tuple","of","details","describing",":","-","The","resolved","class","of","the","model",".","Since","the","source","is","external","to","NeMo",",","always","default","to","using","the","calling","class",".","Depend","on","target","class","resolution","by","restore_from","(",")","for","calling","the","correct","class",".","-","The","path","to","the","NeMo","model","(",".nemo","file",")","in","some","cached","directory","(","managed","by","HF","Hub",")","."]
code: def _get_hf_hub_pretrained_model_info(
      cls, model_name: str, refresh_cache: bool = False
  ) -> Tuple[type, str]:
      """
      Resolve the HuggingFace Hub model pretrained information given a model name.
      The model name must be of general syntax ``{source_repo}/{model_name}``.
  
      Note:
          The ``{source_repo}`` need not be ``nvidia``, it can be any public repository, even external to Nvidia.
          This allows public, externally contributed models to be run freely using Nvidia NeMo.
  
      Args:
          model_name: Str name of the model. Must be the original name or an alias of the model, without any '/'.
          refresh_cache: Bool, determines whether cache must be refreshed (model is re-downloaded).
  
      Returns:
          A tuple of details describing :
          -   The resolved class of the model. Since the source is external to NeMo, always default to using
              the calling class. Depend on target class resolution by restore_from() for calling the correct class.
          -   The path to the NeMo model (.nemo file) in some cached directory (managed by HF Hub).
      """
      # Resolve the model name without origin for filename
      resolved_model_filename = model_name.split("/")[-1] + ".nemo"
  
      # Check if api token exists, use if it does
      is_token_available = HfFolder.get_token() is not None
  
      # Try to load the model from the Huggingface Hub
      path = hf_hub_download(
          repo_id=model_name,
          filename=resolved_model_filename,
          library_name="nemo",
          library_version=nemo.__version__,
          force_download=refresh_cache,
          use_auth_token=is_token_available,
      )
  
      # Cannot pre-resolve the specific class without double instantiation (first for config, second for model params)
      # Default to current class, and perform basic class path resolution (handled via restore_from() + target class)
      class_ = cls
  
      return class_, path
  
imports: import hashlib
  import inspect
  import traceback
  from abc import ABC, abstractmethod
  from contextlib import contextmanager
  from dataclasses import dataclass, field
  from enum import Enum
  from functools import total_ordering
  from pathlib import Path
  from typing import Dict, Iterable, List, Optional, Tuple, Union
  import hydra
  import torch
  import wrapt
  from huggingface_hub import HfApi, HfFolder, ModelFilter, hf_hub_download
  from huggingface_hub.hf_api import ModelInfo
  from omegaconf import DictConfig, OmegaConf
  import nemo
  from nemo.core.connectors.save_restore_connector import SaveRestoreConnector
  from nemo.core.neural_types import NeuralType, NeuralTypeComparisonResult
  from nemo.utils import logging
  from nemo.utils.cloud import maybe_download_from_cloud
  from nemo.utils.data_utils import resolve_cache_dir
  from nemo.utils.model_utils import import_class_by_path, maybe_update_config_version
label_desc: Use image node_id 7 for calling the Model obj's underlying member method code with example usage: obj._get_hf_hub_pretrained_model_info(cls, model_name, refresh_cache) and returns: class_,  path