code: def save_predict_factory(
      cls,
      predict_factory: Type[PredictFactory],
      configs: Dict[str, Any],
      output: Union[str, Path, BinaryIO],
      extra_files: Dict[str, Union[str, bytes]],
      loader_code: str = LOADER_CODE,
      package_importer: Union[
          torch.package.Importer, List[torch.package.Importer]
      ] = torch.package.sys_importer,
  ) -> None:
      with PackageExporter(output, importer=package_importer) as pe:
          # pyre-fixme[29]: `BoundMethod[abc.abstractclassmethod[None],
          #  Type[PredictFactoryPackager]]` is not a function.
          cls.set_extern_modules(pe)
          # pyre-fixme[29]: `BoundMethod[abc.abstractclassmethod[None],
          #  Type[PredictFactoryPackager]]` is not a function.
          cls.set_mocked_modules(pe)
          pe.extern(["sys"])
          pe.intern("**")
          for k, v in extra_files.items():
              if isinstance(v, str):
                  pe.save_text("extra_files", k, v)
              elif isinstance(v, bytes):
                  pe.save_binary("extra_files", k, v)
              else:
                  raise ValueError(f"Unsupported type {type(v)}")
          cls._save_predict_factory(
              pe, predict_factory, configs, loader_code=loader_code
          )
  
file_path: torchrec/torchrec/inference/model_packager.py
imports: import abc
  from pathlib import Path
  from typing import Any, BinaryIO, Dict, List, Type, TypeVar, Union
  import torch
  from torch.package import PackageExporter
  from torchrec.inference.modules import PredictFactory
label_desc: Use image node_id 3 for calling the PredictFactoryPackager obj's underlying member method code with example usage: obj.save_predict_factory(cls, predict_factory, configs, output, extra_files, loader_code, package_importer) without return types