Repository: rasahq/rasa
Issue: loading uncompressed models in cli

<!-- THIS INFORMATION IS MANDATORY - YOUR ISSUE WILL BE CLOSED IF IT IS MISSING. If you don't know your Rasa Core version, use `pip list | grep rasa`. Removing the below information is allowed for FEATURE REQUESTS. --> 

**Rasa version**: `master`

**Python version**: `3.7`

**Operating system** (windows, osx, ...): `macOS x`

**Issue**:
We can store uncompressed train models, but test script cannot load it. I think it would be good to be able to load them


**Content of configuration file (config.yml)**:
```yml

```

**Content of domain file (domain.yml)** (if used & relevant):
```yaml

```

Changed files:
tests/cli/test_rasa_train.py, tests/core/test_model.py, rasa/model.py, rasa/cli/arguments/train.py, rasa/cli/train.py, rasa/train.py, rasa/cli/utils.py

diff --git a/rasa/cli/arguments/train.py b/rasa/cli/arguments/train.py
index 49a1c9e90dd..782668924d2 100644
--- a/rasa/cli/arguments/train.py
+++ b/rasa/cli/arguments/train.py
@@ -23,7 +23,6 @@ def set_train_arguments(parser: argparse.ArgumentParser):
 
     add_model_name_param(parser)
     add_force_param(parser)
-    add_compress_param(parser)
 
 
 def set_train_core_arguments(parser: argparse.ArgumentParser):
@@ -39,7 +38,6 @@ def set_train_core_arguments(parser: argparse.ArgumentParser):
     add_force_param(parser)
 
     add_model_name_param(parser)
-    add_compress_param(parser)
 
     compare_arguments = parser.add_argument_group("Comparison Arguments")
     add_compare_params(compare_arguments)
@@ -52,7 +50,6 @@ def set_train_nlu_arguments(parser: argparse.ArgumentParser):
     add_nlu_data_param(parser, help_text="File or folder containing your NLU data.")
 
     add_model_name_param(parser)
-    add_compress_param(parser)
 
 
 def add_force_param(parser: Union[argparse.ArgumentParser, argparse._ActionsContainer]):
@@ -141,12 +138,3 @@ def add_model_name_param(parser: argparse.ArgumentParser):
         help="If set, the name of the model file/directory will be set to the given "
         "name.",
     )
-
-
-def add_compress_param(parser: argparse.ArgumentParser):
-    parser.add_argument(
-        "--store-uncompressed",
-        action="store_true",
-        help="If set the model is not compressed. Note: You need a compressed model "
-        "file for running the Rasa Server, testing a model, etc.",
-    )
diff --git a/rasa/cli/train.py b/rasa/cli/train.py
index cb85b9258a4..08f2e54a08b 100644
--- a/rasa/cli/train.py
+++ b/rasa/cli/train.py
@@ -66,7 +66,6 @@ def train(args: argparse.Namespace) -> Optional[Text]:
         output=args.out,
         force_training=args.force,
         fixed_model_name=args.fixed_model_name,
-        uncompress=args.store_uncompressed,
         kwargs=extract_additional_arguments(args),
     )
 
@@ -104,7 +103,6 @@ def train_core(
             output=output,
             train_path=train_path,
             fixed_model_name=args.fixed_model_name,
-            uncompress=args.store_uncompressed,
             kwargs=extract_additional_arguments(args),
         )
     else:
@@ -132,7 +130,6 @@ def train_nlu(
         output=output,
         train_path=train_path,
         fixed_model_name=args.fixed_model_name,
-        uncompress=args.store_uncompressed,
     )
 
 
diff --git a/rasa/cli/utils.py b/rasa/cli/utils.py
index 59fc1f31ce0..7be5298f973 100644
--- a/rasa/cli/utils.py
+++ b/rasa/cli/utils.py
@@ -119,7 +119,8 @@ def create_output_path(
         else:
             time_format = "%Y%m%d-%H%M%S"
             name = time.strftime(time_format)
-        file_name = "{}{}.tar.gz".format(prefix, name)
+            name = "{}{}".format(prefix, name)
+        file_name = "{}.tar.gz".format(name)
         return os.path.join(output_path, file_name)
 
 
diff --git a/rasa/model.py b/rasa/model.py
index dc42499b4d1..bab1e10e480 100644
--- a/rasa/model.py
+++ b/rasa/model.py
@@ -191,23 +191,6 @@ def create_package_rasa(
     return output_filename
 
 
-def decompress(model_path: Text):
-    """Decompresses the provided zipped Rasa model.
-
-    Args:
-        model_path: Path to the zipped Rasa model.
-
-    Returns:
-        Path to unzipped Rasa model.
-    """
-    zipped_path = model_path
-    output_path = model_path.replace(".tar.gz", "")
-    unpack_model(zipped_path, output_path)
-    os.remove(zipped_path)
-
-    return output_path
-
-
 def model_fingerprint(
     config_file: Text,
     domain: Optional[Union[Domain, Text]] = None,
diff --git a/rasa/train.py b/rasa/train.py
index 89692823616..6daef5eb8c6 100644
--- a/rasa/train.py
+++ b/rasa/train.py
@@ -5,7 +5,7 @@ from typing import Text, Optional, List, Union, Dict
 
 from rasa import model, data
 from rasa.core.domain import Domain, InvalidDomain
-from rasa.model import decompress, Fingerprint, should_retrain
+from rasa.model import Fingerprint, should_retrain
 from rasa.skill import SkillSelector
 
 from rasa.cli.utils import (
@@ -34,7 +34,6 @@ def train(
     output: Text = DEFAULT_MODELS_PATH,
     force_training: bool = False,
     fixed_model_name: Optional[Text] = None,
-    uncompress: bool = False,
     kwargs: Optional[Dict] = None,
 ) -> Optional[Text]:
     loop = asyncio.get_event_loop()
@@ -46,7 +45,6 @@ def train(
             output_path=output,
             force_training=force_training,
             fixed_model_name=fixed_model_name,
-            uncompress=uncompress,
             kwargs=kwargs,
         )
     )
@@ -59,7 +57,6 @@ async def train_async(
     output_path: Text = DEFAULT_MODELS_PATH,
     force_training: bool = False,
     fixed_model_name: Optional[Text] = None,
-    uncompress: bool = False,
     kwargs: Optional[Dict] = None,
 ) -> Optional[Text]:
     """Trains a Rasa model (Core and NLU).
@@ -116,7 +113,6 @@ async def train_async(
             nlu_data_directory=nlu_data_directory,
             output=output_path,
             fixed_model_name=fixed_model_name,
-            uncompress=uncompress,
         )
 
     if nlu_data_not_present:
@@ -127,7 +123,6 @@ async def train_async(
             story_directory=story_directory,
             output=output_path,
             fixed_model_name=fixed_model_name,
-            uncompress=uncompress,
             kwargs=kwargs,
         )
 
@@ -146,7 +141,6 @@ async def train_async(
             retrain_core=retrain_core,
             retrain_nlu=retrain_nlu,
             fixed_model_name=fixed_model_name,
-            uncompress=uncompress,
             kwargs=kwargs,
         )
 
@@ -155,7 +149,6 @@ async def train_async(
             output_path=output_path,
             train_path=train_path,
             fixed_model_name=fixed_model_name,
-            uncompress=uncompress,
         )
 
     print_success(
@@ -176,7 +169,6 @@ async def _do_training(
     retrain_core: bool = True,
     retrain_nlu: bool = True,
     fixed_model_name: Optional[Text] = None,
-    uncompress: bool = False,
     kwargs: Optional[Dict] = None,
 ):
 
@@ -188,7 +180,6 @@ async def _do_training(
             output=output_path,
             train_path=train_path,
             fixed_model_name=fixed_model_name,
-            uncompress=uncompress,
             kwargs=kwargs,
         )
     else:
@@ -201,7 +192,6 @@ async def _do_training(
             output=output_path,
             train_path=train_path,
             fixed_model_name=fixed_model_name,
-            uncompress=uncompress,
         )
     else:
         print ("NLU data / configuration did not change. No need to retrain NLU model.")
@@ -214,7 +204,6 @@ def train_core(
     output: Text,
     train_path: Optional[Text] = None,
     fixed_model_name: Optional[Text] = None,
-    uncompress: bool = False,
     kwargs: Optional[Dict] = None,
 ) -> Optional[Text]:
     loop = asyncio.get_event_loop()
@@ -226,7 +215,6 @@ def train_core(
             output=output,
             train_path=train_path,
             fixed_model_name=fixed_model_name,
-            uncompress=uncompress,
             kwargs=kwargs,
         )
     )
@@ -239,7 +227,6 @@ async def train_core_async(
     output: Text,
     train_path: Optional[Text] = None,
     fixed_model_name: Optional[Text] = None,
-    uncompress: bool = False,
     kwargs: Optional[Dict] = None,
 ) -> Optional[Text]:
     """Trains a Core model.
@@ -290,7 +277,6 @@ async def train_core_async(
         output=output,
         train_path=train_path,
         fixed_model_name=fixed_model_name,
-        uncompress=uncompress,
         kwargs=kwargs,
     )
 
@@ -302,7 +288,6 @@ async def _train_core_with_validated_data(
     output: Text,
     train_path: Optional[Text] = None,
     fixed_model_name: Optional[Text] = None,
-    uncompress: bool = False,
     kwargs: Optional[Dict] = None,
 ) -> Optional[Text]:
     """Train Core with validated training and config data."""
@@ -333,7 +318,6 @@ async def _train_core_with_validated_data(
             train_path=_train_path,
             fixed_model_name=fixed_model_name,
             model_prefix="core-",
-            uncompress=uncompress,
         )
 
     return _train_path
@@ -345,7 +329,6 @@ def train_nlu(
     output: Text,
     train_path: Optional[Text] = None,
     fixed_model_name: Optional[Text] = None,
-    uncompress: bool = False,
 ) -> Optional[Text]:
     """Trains an NLU model.
 
@@ -382,7 +365,6 @@ def train_nlu(
         output=output,
         train_path=train_path,
         fixed_model_name=fixed_model_name,
-        uncompress=uncompress,
     )
 
 
@@ -392,7 +374,6 @@ def _train_nlu_with_validated_data(
     output: Text,
     train_path: Optional[Text] = None,
     fixed_model_name: Optional[Text] = None,
-    uncompress: bool = False,
 ) -> Optional[Text]:
     """Train NLU with validated training and config data."""
 
@@ -416,7 +397,6 @@ def _train_nlu_with_validated_data(
             train_path=_train_path,
             fixed_model_name=fixed_model_name,
             model_prefix="nlu-",
-            uncompress=uncompress,
         )
 
     return _train_path
@@ -458,16 +438,12 @@ def _package_model(
     train_path: Text,
     fixed_model_name: Optional[Text] = None,
     model_prefix: Text = "",
-    uncompress: bool = False,
 ):
     output_path = create_output_path(
         output_path, prefix=model_prefix, fixed_name=fixed_model_name
     )
     model.create_package_rasa(train_path, output_path, new_fingerprint)
 
-    if uncompress:
-        output_path = decompress(output_path)
-
     print_success(
         "Your Rasa model is trained and saved at '{}'.".format(
             os.path.abspath(output_path)
diff --git a/tests/cli/test_rasa_train.py b/tests/cli/test_rasa_train.py
index 78f91469963..b04d3bdd435 100644
--- a/tests/cli/test_rasa_train.py
+++ b/tests/cli/test_rasa_train.py
@@ -70,7 +70,7 @@ def test_train_with_only_nlu_data(run_in_default_project):
     assert os.path.exists(os.path.join(temp_dir, "models"))
     files = list_files(os.path.join(temp_dir, "models"))
     assert len(files) == 1
-    assert os.path.basename(files[0]) == "nlu-test-model.tar.gz"
+    assert os.path.basename(files[0]) == "test-model.tar.gz"
 
 
 def test_train_with_only_core_data(run_in_default_project):
@@ -85,7 +85,7 @@ def test_train_with_only_core_data(run_in_default_project):
     assert os.path.exists(os.path.join(temp_dir, "models"))
     files = list_files(os.path.join(temp_dir, "models"))
     assert len(files) == 1
-    assert os.path.basename(files[0]) == "core-test-model.tar.gz"
+    assert os.path.basename(files[0]) == "test-model.tar.gz"
 
 
 def test_train_core(run_in_default_project):
@@ -100,13 +100,12 @@ def test_train_core(run_in_default_project):
         "data",
         "--out",
         "train_rasa_models",
-        "--store-uncompressed",
         "--fixed-model-name",
         "rasa-model",
     )
 
-    assert os.path.exists("train_rasa_models/core-rasa-model")
-    assert os.path.isdir("train_rasa_models/core-rasa-model")
+    assert os.path.exists("train_rasa_models/rasa-model.tar.gz")
+    assert os.path.isfile("train_rasa_models/rasa-model.tar.gz")
 
 
 def test_train_nlu(run_in_default_project):
@@ -134,7 +133,7 @@ def test_train_help(run):
                   [-c CONFIG] [-d DOMAIN] [--out OUT]
                   [--augmentation AUGMENTATION] [--debug-plots]
                   [--dump-stories] [--fixed-model-name FIXED_MODEL_NAME]
-                  [--force] [--store-uncompressed]
+                  [--force]
                   {core,nlu} ..."""
 
     lines = help_text.split("\\n")
@@ -147,8 +146,7 @@ def test_train_nlu_help(run):
     output = run("train", "nlu", "--help")
 
     help_text = """usage: rasa train nlu [-h] [-v] [-vv] [--quiet] [-c CONFIG] [--out OUT]
-                      [-u NLU] [--fixed-model-name FIXED_MODEL_NAME]
-                      [--store-uncompressed]"""
+                      [-u NLU] [--fixed-model-name FIXED_MODEL_NAME]"""
 
     lines = help_text.split("\\n")
 
@@ -164,7 +162,6 @@ def test_train_core_help(run):
                        [--augmentation AUGMENTATION] [--debug-plots]
                        [--dump-stories] [--force]
                        [--fixed-model-name FIXED_MODEL_NAME]
-                       [--store-uncompressed]
                        [--percentages [PERCENTAGES [PERCENTAGES ...]]]
                        [--runs RUNS]"""
 
diff --git a/tests/core/test_model.py b/tests/core/test_model.py
index 854df960867..942b7f4991a 100644
--- a/tests/core/test_model.py
+++ b/tests/core/test_model.py
@@ -28,7 +28,6 @@ from rasa.model import (
     nlu_fingerprint_changed,
     Fingerprint,
     should_retrain,
-    decompress,
 )
 
 
@@ -241,11 +240,3 @@ def set_fingerprint(
     create_package_rasa(unpacked_model_path, output_path, fingerprint)
 
     return output_path
-
-
-def test_decompress(trained_model):
-    output_path = decompress(trained_model)
-
-    assert os.path.exists(output_path)
-    assert os.path.isdir(output_path)
-    assert not os.path.exists(trained_model)