class_docstr: Store models in cloud and fetch them when needed.
class_docstr_tok: ["Store","models","in","cloud","and","fetch","them","when","needed","."]
docstr: Creates a compressed archive and returns key and tar.
docstr_tok: ["Creates","a","compressed","archive","and","returns","key","and","tar","."]
code: def _compress(
      self, model_directory: Text, model_name: Text
  ) -> Tuple[Text, Text]:
      """Creates a compressed archive and returns key and tar."""
      import tempfile
  
      dirpath = tempfile.mkdtemp()
      base_name = self._tar_name(model_name, include_extension=False)
      tar_name = shutil.make_archive(
          os.path.join(dirpath, base_name),
          "gztar",
          root_dir=model_directory,
          base_dir=".",
      )
      file_key = os.path.basename(tar_name)
      return file_key, tar_name
  
imports: import abc
  import logging
  import os
  import shutil
  from typing import Optional, Text, Tuple, TYPE_CHECKING
  import rasa.shared.utils.common
  import rasa.utils.common
label_desc: Use image node_id 5 for calling the Persistor obj's underlying member method code with example usage: obj._compress(model_directory, model_name) and returns: file_key,  tar_name