def checksum(self, zipfile, featurizer_config, text_embedder_cfg):
    checksum = md5(json.dumps(featurizer_config._asdict(), sort_keys=True).encode('utf-8'))
    text_embedder_cfg = text_embedder_cfg._asdict()
    del text_embedder_cfg['preproc_dir']
    del text_embedder_cfg['use_cuda_if_available']
    checksum.update(json.dumps(text_embedder_cfg, sort_keys=True).encode('utf-8'))
    md5file = (zipfile + '.md5')
    if (os.path.exists(md5file) and (os.path.getmtime(zipfile) <= os.path.getmtime(md5file))):
        with open(md5file, 'rt') as f:
            checksum.update(f.read().split()[0].strip().encode('utf-8'))
    else:
        with open(zipfile, 'rb') as f:
            checksum.update(md5(f.read()).hexdigest().encode('utf-8'))
    checksum.update(pickle.dumps(sorted(self.domains)))
    checksum.update(pickle.dumps(sorted(self.paths)))
    checksum.update(pickle.dumps(sorted(self.tasks)))
    return checksum.hexdigest()
def checksum(self, zipfile, featurizer_config, text_embedder_cfg):
    checksum = md5(json.dumps(featurizer_config._asdict(), sort_keys=True).encode('utf-8'))
    text_embedder_cfg = text_embedder_cfg._asdict()
    del text_embedder_cfg['preproc_dir']
    del text_embedder_cfg['use_cuda_if_available']
    checksum.update(json.dumps(text_embedder_cfg, sort_keys=True).encode('utf-8'))
    md5file = (zipfile + '.md5')
    if (os.path.exists(md5file) and (os.path.getmtime(zipfile) <= os.path.getmtime(md5file))):
        with open(md5file, 'rt') as f:
            checksum.update(f.read().split()[0].strip().encode('utf-8'))
    else:
        with open(zipfile, 'rb') as f:
            checksum.update(md5(f.read()).hexdigest().encode('utf-8'))
    checksum.update(pickle.dumps(sorted(self.domains)))
    checksum.update(pickle.dumps(sorted(self.paths)))
    checksum.update(pickle.dumps(sorted(self.tasks)))
    return checksum.hexdigest()