'Loads the metadata from a models directory.'

@staticmethod
def load(model_dir):

    try:
        with io.open(os.path.join(model_dir, u'metadata.json'), encoding=u'utf-8') as f:
            data = json.loads(f.read())
        return Metadata(data, model_dir)
    except Exception as e:
        raise InvalidModelError(u'Failed    to    load    model    metadata.    {}'.format(e))
