def _model_version_check(file_version, code_version):
    """
    Checks if a saved model file with version (file_version)
    is compatible with the current code version (code_version).
    Throws an exception telling the user to upgrade.
    """
    if file_version > code_version:
        raise RuntimeError(
            """Failed to load model file.

The model that you are trying to load was saved with a newer version of
Turi Create than what you have. Please upgrade before attempting to load
the file again:

    pip install -U turicreate
"""
            )
