Steps to reproduce the behavior (always include the command you ran):
Try to run the example at fairseq/examples/xglm/
Stack trace:
Traceback (most recent call last):
File "go.py", line 75, in <module>
predict = COPA_eval(example["premise"], example["choice1"], example["choice2"])
File "go.py", line 69, in COPA_eval
lprob1 = get_logprobs(prompt + "\n" + alternative1).sum()
File "go.py", line 63, in get_logprobs
return lm.score(prompt, replace_newlines_with_eos=True)['positional_scores']
File "/home/ancruzsa/fairseq/fairseq/hub_utils.py", line 139, in score
return self.score(
File "/home/ancruzsa/fairseq/fairseq/hub_utils.py", line 153, in score
for hypos in self.generate(
File "/home/ancruzsa/fairseq/fairseq/hub_utils.py", line 187, in generate
for batch in self._build_batches(tokenized_sentences, skip_invalid_size_inputs):
File "/home/ancruzsa/fairseq/fairseq/hub_utils.py", line 275, in _build_batches
dataset=self.task.build_dataset_for_inference(tokens, lengths),
File "/home/ancruzsa/fairseq/fairseq/tasks/multilingual_language_modeling.py", line 533, in build_dataset_for_inference
"src_tokens": PadDataset(
TypeError: __init__() got an unexpected keyword argument 'pad_length'
Code sample
Example at fairseq/examples/xglm/, however this is also broken. See #4210 to be able to get the stacktrace above.
Expected behavior
Calling build_dataset_for_inference should not fail this way.
Environment
fairseq Version (e.g., 1.0 or main): main
PyTorch Version (e.g., 1.0)
OS (e.g., Linux):
How you installed fairseq (pip, source):
Build command you used (if compiling from source):
🐛 Bug
On
multilingual_language_modeling.py
the methodbuild_dataset_for_inference
creates an instance ofPadDataset
and passespad_length = max_seq_len
as an argument. However, onpad_dataset.py
the constructor ofPadDataset
does not have the argumentpad_length
.To Reproduce
Steps to reproduce the behavior (always include the command you ran):
fairseq/examples/xglm/
Stack trace:Code sample
Example at
fairseq/examples/xglm/
, however this is also broken. See #4210 to be able to get the stacktrace above.Expected behavior
Calling
build_dataset_for_inference
should not fail this way.Environment
pip
, source):Additional context