Open YatinKapoor opened 2 years ago
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
batch = tokenizer(src_text, truncation=True, padding='longest', return_tensors="pt").to(device)
--------------------------------------------------------------------------- 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
batch = tokenizer.prepare_seq2seq_batch(src_text, truncation=True, padding='longest', return_tensors='pt').to(torch_device)
--------------------------------------------------------------------------- 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.
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 errorI 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 errorAny help would be greatly appreciated.