rasa/core/agent.py
def _clear_model_directory(model_path: Text) -> None:
        """Remove existing files from model directory.

        Only removes files if the directory seems to contain a previously
        persisted model. Otherwise does nothing to avoid deleting
        `/` by accident."""

        if not os.path.exists(model_path):
            return

        domain_spec_path = os.path.join(model_path, 'metadata.json')
        # check if there were a model before
        if os.path.exists(domain_spec_path):
            logger.info("Model directory {} exists and contains old "
                        "model files. All files will be overwritten."
                        "".format(model_path))
            shutil.rmtree(model_path)
        else:
            logger.debug("Model directory {} exists, but does not contain "
                         "all old model files. Some files might be "
                         "overwritten.".format(model_path))
Remove existing files from model directory.

        Only removes files if the directory seems to contain a previously
        persisted model. Otherwise does nothing to avoid deleting
        `/` by accident.
Remove existing files from model directory.
Only removes files if the directory seems to contain a previously
persisted model. Otherwise does nothing to avoid deleting
`/` by accident.
Remove existing files from model directory . Only removes files if the directory seems to contain a previously persisted model . Otherwise does nothing to avoid deleting ` / ` by accident .
def _clear_model_directory(model_path: Text) -> None:
        if not os.path.exists(model_path):
            return
        domain_spec_path = os.path.join(model_path, 'metadata.json')
        if os.path.exists(domain_spec_path):
            logger.info("Model directory {} exists and contains old "
                        "model files. All files will be overwritten."
                        "".format(model_path))
            shutil.rmtree(model_path)
        else:
            logger.debug("Model directory {} exists, but does not contain "
                         "all old model files. Some files might be "
                         "overwritten.".format(model_path))
def _clear_model_directory ( model_path : Text ) -> None : if not os . path . exists ( model_path ) : return domain_spec_path = os . path . join ( model_path , 'metadata.json' ) if os . path . exists ( domain_spec_path ) : logger . info ( "Model directory {} exists and contains old " "model files. All files will be overwritten." "" . format ( model_path ) ) shutil . rmtree ( model_path ) else : logger . debug ( "Model directory {} exists, but does not contain " "all old model files. Some files might be " "overwritten." . format ( model_path ) )
Remove existing files from model directory.
Remove existing files from model directory .
"""Remove existing files from model directory.

        Only removes files if the directory seems to contain a previously
        persisted model. Otherwise does nothing to avoid deleting
        `/` by accident.""" # check if there were a model before
model_path
Text