import tempfile
import tarfile


def create_model_archive(model_location):
    """
    Creates a temporary archvie of the model and returns its location.
    """
    _, tar_location = tempfile.mkstemp()
    with tarfile.open(tar_location, "w:gz") as tarout:
        tarout.add(model_location, arcname="")
    return tar_location