CQCL / lambeq

A high-level Python library for Quantum Natural Language Processing
https://cqcl.github.io/lambeq/
Apache License 2.0
439 stars 106 forks source link

BobCatParser didn't get downloaded!! #74

Closed yousrabou closed 1 year ago

yousrabou commented 1 year ago

Greetings, Lambeq team. I was able to use BobCatParser until yesterday, when I started getting this problem every time I tried to execute this line of code !!!

What should I do to correct this error?

---------------------------------------------------------------My code --------------------------------------------------------------------------- 1 from lambeq import BobcatParser 2 ----> 3 parser = BobcatParser(verbose='text') 4 5 raw_train_diagrams = parser.sentences2diagrams(train_data, suppress_exceptions=True)

-------------------------------------- The error ---------------------------------------------------------------------------- 2 frames /usr/local/lib/python3.9/dist-packages/lambeq/text2diagram/bobcat_parser.py in init(self, model_name_or_path, root_cats, device, cache_dir, force_download, verbose, **kwargs) 265 raise ValueError('Invalid model name or path: ' 266 f'{model_name_or_path!r}') --> 267 download_model(model_name_or_path, model_dir, verbose) 268 269 with open(model_dir / 'pipeline_config.json') as f:

/usr/local/lib/python3.9/dist-packages/lambeq/text2diagram/bobcat_parser.py in download_model(model_name, model_dir, verbose) 144 if verbose != VerbosityLevel.SUPPRESS.value: 145 print('Extracting model...') --> 146 tar = tarfile.open(fileobj=model_file) 147 tar.extractall(model_dir) 148 model_file.close()

/usr/lib/python3.9/tarfile.py in open(cls, name, mode, fileobj, bufsize, **kwargs) 1623 fileobj.seek(saved_pos) 1624 continue -> 1625 raise ReadError("file could not be opened successfully") 1626 1627 elif ":" in mode:

ReadError: file could not be opened successfully

nikhilkhatri commented 1 year ago

Hi @yousrabou , This bug is fixed in the latest release (0.3.0). Could you try updating your lambeq installation and see if that fixes the issue?

yousrabou commented 1 year ago

the issue is fixed , thank you @nikhilkhatri