Skip to content
New issue

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

Unable to generate summary when initializing model with PyTorch #35

Open
yungsinatra0 opened this issue Aug 9, 2023 · 1 comment
Open

Comments

@yungsinatra0
Copy link

yungsinatra0 commented Aug 9, 2023

Hello, I've tried initializing the model using the provided example in the README:

model = BRIO('Yale-LILY/brio-cnndm-uncased', tok.pad_token_id, is_pegasus=False)

However I've been facing some issues when trying to use it for inference:

  1. I keep getting issues that parameters used by .generate() method have value of None. I've tried just putting some default values as shown here. Here's how it looks :
inputs = tokenizer([article], max_length=max_length, return_tensors="pt", truncation=True)
summary_ids = model.generate(inputs["input_ids"],
                                     early_stopping=False,
                                     max_length=1024,
                                     num_beams=1,
                                     num_beam_groups=1)
  1. This brings me to my second issue, where the .generate() method does not create any ids. Whenever I try to decode the generated summary, I get the error TypeError: 'NoneType' object is not iterable. When checking the type or content of summary_ids, I get None or <class 'NoneType'>.

Why is this happening? When loading the pre-trained models straight from HF, I don't have any issues but this one does not seem to be working.

@thieugiactu
Copy link

It's the problem with transformers's version, just use transformer==4.24.0 or anything bellow would work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants