docstr: Overwrite this method in subclass to define how to load your model from pretrained
docstr_tok: ["Overwrite","this","method","in","subclass","to","define","how","to","load","your","model","from","pretrained"]
code: def _from_pretrained(
      cls,
      model_id: Union[str, Path],
      config: PretrainedConfig,
      use_auth_token: Optional[Union[bool, str]] = None,
      revision: Optional[str] = None,
      force_download: bool = False,
      cache_dir: Optional[str] = None,
      subfolder: str = "",
      local_files_only: bool = False,
      **kwargs,
  ) -> "OptimizedModel":
      """Overwrite this method in subclass to define how to load your model from pretrained"""
      raise NotImplementedError(
          "Overwrite this method in subclass to define how to load your model from pretrained"
      )
  
imports: import logging
  import os
  import subprocess
  from abc import ABC, abstractmethod
  from pathlib import Path
  from typing import TYPE_CHECKING, Optional, Union
  from huggingface_hub import HfApi, HfFolder
  from transformers import AutoConfig, PretrainedConfig, add_start_docstrings
  from .exporters import TasksManager
  from .utils import CONFIG_NAME
label_desc: Use image node_id 10 for calling the OptimizedModel obj's underlying member method code with example usage: obj._from_pretrained(cls, model_id, config, use_auth_token, revision, force_download, cache_dir, subfolder, local_files_only) without return types