rasa/model.py
def unpack_model(model_file: Text, working_directory: Optional[Text] = None
                 ) -> Text:
    """Unpacks a zipped Rasa model.

    Args:
        model_file: Path to zipped model.
        working_directory: Location where the model should be unpacked to.
                           If `None` a temporary directory will be created.

    Returns:
        Path to unpacked Rasa model.

    """
    import tarfile

    if working_directory is None:
        working_directory = tempfile.mkdtemp()

    tar = tarfile.open(model_file)

    # cast `working_directory` as str for py3.5 compatibility
    working_directory = str(working_directory)

    # All files are in a subdirectory.
    tar.extractall(working_directory)
    tar.close()
    logger.debug("Extracted model to '{}'.".format(working_directory))

    return working_directory
Unpacks a zipped Rasa model.

    Args:
        model_file: Path to zipped model.
        working_directory: Location where the model should be unpacked to.
                           If `None` a temporary directory will be created.

    Returns:
        Path to unpacked Rasa model.

    
Unpacks a zipped Rasa model.
Unpacks a zipped Rasa model .
def unpack_model(model_file: Text, working_directory: Optional[Text] = None
                 ) -> Text:
    import tarfile
    if working_directory is None:
        working_directory = tempfile.mkdtemp()
    tar = tarfile.open(model_file)
    working_directory = str(working_directory)
    tar.extractall(working_directory)
    tar.close()
    logger.debug("Extracted model to '{}'.".format(working_directory))
    return working_directory
def unpack_model ( model_file : Text , working_directory : Optional [ Text ] = None ) -> Text : import tarfile if working_directory is None : working_directory = tempfile . mkdtemp ( ) tar = tarfile . open ( model_file ) working_directory = str ( working_directory ) tar . extractall ( working_directory ) tar . close ( ) logger . debug ( "Extracted model to '{}'." . format ( working_directory ) ) return working_directory
Unpacks a zipped Rasa model.
Unpacks a zipped Rasa model .
"""Unpacks a zipped Rasa model.

    Args:
        model_file: Path to zipped model.
        working_directory: Location where the model should be unpacked to.
                           If `None` a temporary directory will be created.

    Returns:
        Path to unpacked Rasa model.

    """ # cast `working_directory` as str for py3.5 compatibility # All files are in a subdirectory.
Path to unpacked Rasa model.
Path to unpacked Rasa model .
model_file
Text
Path to zipped model.
Path to zipped model .
working_directory
Optional[Text]
Location where the model should be unpacked to.
If `None` a temporary directory will be created.
Location where the model should be unpacked to . If ` None ` a temporary directory will be created .