We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The decoding code is currently not compatible with versions of Hugging Face transformers >= v4.39:
====================================================================== ERROR: test_generate (test_generate.DecoderOnlyTestCase.test_generate) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/runner/work/mbr/mbr/tests/test_generate.py", line 28, in test_generate output = self.model.generate( ^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/torch/utils/_contextlib.py", line 115, in decorate_context return func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/mbr/generation/utils.py", line 344, in generate generation_mode = self._get_generation_mode(generation_config, assistant_model) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/hostedtoolcache/Python/3.11.9/x64/lib/python3.11/site-packages/torch/nn/modules/module.py", line 1709, in __getattr__ raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'") AttributeError: 'MBRGPT2LMHeadModel' object has no attribute '_get_generation_mode'
The text was updated successfully, but these errors were encountered:
Hi! I could make it work using transformers==4.43.3
transformers==4.43.3
diff src/mbr/generation/utils.py local_installation/src/mbr/generation/utils.py:
diff src/mbr/generation/utils.py local_installation/src/mbr/generation/utils.py
18d17 < from mbr.metrics import load_metric_runner 227,229d225 < if generation_config.num_return_sequences > 1: < raise ValueError("MBR decoding does not support `num_return_sequences` > 1.") < 347c343 < generation_mode = self._get_generation_mode(generation_config, assistant_model) --- > generation_mode = generation_config.get_generation_mode(assistant_model) 387a384,388 > if not hasattr(generation_config, "_eos_token_tensor"): > setattr(generation_config, "_eos_token_tensor", torch.tensor([generation_config.eos_token_id]).to(inputs_tensor.device)) > if not hasattr(generation_config, "_pad_token_tensor"): > setattr(generation_config, "_pad_token_tensor", torch.tensor([generation_config.eos_token_id]).to(inputs_tensor.device)) > 414c415 < logits_warper = self._get_logits_warper(generation_config) --- > logits_warper = self._get_logits_warper(generation_config, inputs_tensor.device,) 432c433 < samples.append(self.sample( --- > samples.append(self._sample( 436a438 > generation_config=generation_config, 457c459 < logits_warper = self._get_logits_warper(references_config) --- > logits_warper = self._get_logits_warper(references_config, inputs_tensor.device) 467c469 < references.append(self.sample( --- > references.append(self._sample( 471a474 > generation_config=generation_config, 483c486 < metric_runner = load_metric_runner(mbr_config, tokenizer) --- > metric_runner = MetricRunner(mbr_config, tokenizer)
Sorry, something went wrong.
No branches or pull requests
The decoding code is currently not compatible with versions of Hugging Face transformers >= v4.39:
The text was updated successfully, but these errors were encountered: