Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

Summarization error #202

Open
YatinKapoor opened this issue Aug 21, 2021 · 0 comments
Open

Summarization error #202

YatinKapoor opened this issue Aug 21, 2021 · 0 comments

Comments

@YatinKapoor
Copy link

Hi, I am new into this and was trying to run the example given at LINK

However, on running
batch = tokenizer(src_text, truncation=True, padding='longest', return_tensors="pt").to(device)
I am getting the error

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-49-e6e55e18a32c> in <module>()
----> 1 batch = tokenizer(src_text, truncation=True, padding='longest', return_tensors="pt").to(device)
      2 translated = model.generate(**batch)
      3 tgt_text = tokenizer.batch_decode(translated, skip_special_tokens=True)

TypeError: 'NoneType' object is not callable

I also tried running batch = tokenizer.prepare_seq2seq_batch(src_text, truncation=True, padding='longest', return_tensors='pt').to(torch_device)
But I am getting the error

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-50-b7183fa2a37c> in <module>()
----> 1 batch = tokenizer.prepare_seq2seq_batch(src_text, truncation=True, padding='longest', return_tensors='pt').to(torch_device)
      2 translated = model.generate(**batch)
      3 tgt_text = tokenizer.batch_decode(translated, skip_special_tokens=True)

AttributeError: 'NoneType' object has no attribute 'prepare_seq2seq_batch'

Any help would be greatly appreciated.

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

No branches or pull requests

1 participant