docstr: Restores model instance (weights and configuration) from a .nemo file
  
  Args:
      restore_path: path to .nemo file from which model should be instantiated
      override_config_path: path to a yaml config that will override the internal
          config file or an OmegaConf / DictConfig object representing the model config.
      map_location: Optional torch.device() to map the instantiated model to a device.
          By default (None), it will select a GPU if available, falling back to CPU otherwise.
      strict: Passed to load_state_dict. By default True
      return_config: If set to true, will return just the underlying config of the restored
          model as an OmegaConf DictConfig object without instantiating the model.
      trainer: An optional Trainer object, passed to the model constructor.
      save_restore_connector: An optional SaveRestoreConnector object that defines the implementation
          of the restore_from() method.
docstr_tok: ["Restores","model","instance","(","weights","and","configuration",")","from","a",".nemo","file","Args",":","restore_path",":","path","to",".nemo","file","from","which","model","should","be","instantiated","override_config_path",":","path","to","a","yaml","config","that","will","override","the","internal","config","file","or","an","OmegaConf","\/","DictConfig","object","representing","the","model","config",".","map_location",":","Optional","torch.device","(",")","to","map","the","instantiated","model","to","a","device",".","By","default","(","None",")",",","it","will","select","a","GPU","if","available",",","falling","back","to","CPU","otherwise",".","strict",":","Passed","to","load_state_dict",".","By","default","True","return_config",":","If","set","to","true",",","will","return","just","the","underlying","config","of","the","restored","model","as","an","OmegaConf","DictConfig","object","without","instantiating","the","model",".","trainer",":","An","optional","Trainer","object",",","passed","to","the","model","constructor",".","save_restore_connector",":","An","optional","SaveRestoreConnector","object","that","defines","the","implementation","of","the","restore_from","(",")","method","."]
code: def restore_from(
      cls,
      restore_path: str,
      override_config_path: Optional[str] = None,
      map_location: Optional["torch.device"] = None,
      strict: bool = True,
      return_config: bool = False,
      trainer: Optional["Trainer"] = None,
      save_restore_connector: SaveRestoreConnector = None,
  ):
      """
      Restores model instance (weights and configuration) from a .nemo file
  
      Args:
          restore_path: path to .nemo file from which model should be instantiated
          override_config_path: path to a yaml config that will override the internal
              config file or an OmegaConf / DictConfig object representing the model config.
          map_location: Optional torch.device() to map the instantiated model to a device.
              By default (None), it will select a GPU if available, falling back to CPU otherwise.
          strict: Passed to load_state_dict. By default True
          return_config: If set to true, will return just the underlying config of the restored
              model as an OmegaConf DictConfig object without instantiating the model.
          trainer: An optional Trainer object, passed to the model constructor.
          save_restore_connector: An optional SaveRestoreConnector object that defines the implementation
              of the restore_from() method.
      """
      raise NotImplementedError()
  
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 2 for calling the FileIO obj's underlying member method code with example usage: obj.restore_from(cls, restore_path, override_config_path, map_location, strict, return_config, trainer, save_restore_connector) without return types