Skip to content

Commit 55a32c2

Browse files
author
Jan Ludwiczak
committed
Add backup url for SeqVec weights download
1 parent 58a3119 commit 55a32c2

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

deepcoil/deepcoil.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,16 @@ def _setup_seqvec(self):
6363
seqvec_weights_fn = f'{seqvec_dir}/uniref50_v2/weights.hdf5'
6464
if not (os.path.isfile(seqvec_conf_fn) and os.path.isfile(seqvec_weights_fn)):
6565
print('SeqVec weights are not available, downloading from the remote source (this\'ll happen only once)...')
66-
seqvec_zip_fn = get_file(f'{self._path}/weights/seqvec.zip', 'https://rostlab.org/~deepppi/seqvec.zip')
67-
archive = ZipFile(seqvec_zip_fn)
68-
archive.extract('uniref50_v2/options.json', seqvec_dir)
69-
archive.extract('uniref50_v2/weights.hdf5', seqvec_dir)
66+
urls = ['https://rostlab.org/~deepppi/seqvec.zip', 'https://lbs.cent.uw.edu.pl/static/files/seqvec.zip']
67+
for url in urls:
68+
try:
69+
seqvec_zip_fn = get_file(f'{self._path}/weights/seqvec.zip', url)
70+
archive = ZipFile(seqvec_zip_fn)
71+
archive.extract('uniref50_v2/options.json', seqvec_dir)
72+
archive.extract('uniref50_v2/weights.hdf5', seqvec_dir)
73+
break
74+
except:
75+
print(f'Could not download SeqVec weights from url: {url}')
7076
if self.use_gpu:
7177
return SeqVec(model_dir=f'{seqvec_dir}/uniref50_v2', cuda_device=0, tokens_per_batch=8000)
7278
else:

0 commit comments

Comments
 (0)