ShuyangCao / cliff_summ

Code for EMNLP 2021 paper "CLIFF: Contrastive Learning for Improving Faithfulness and Factuality in Abstractive Summarization"
Apache License 2.0
45 stars 8 forks source link

NameError: name 'old' is not defined in contrastive_translation_multi_neg.py #17

Open chris-opendata opened 1 year ago

chris-opendata commented 1 year ago

I ran train_xsum_multi_neg.sh and got the following error. It happens with both old and new implementations based on BART backbone.

Traceback (most recent call last):
  File "/home/chshen/dev/pyvenv/lib64/python3.8/site-packages/torch/multiprocessing/spawn.py", line 69, in _wrap
    fn(i, *args)
  File "/home/chshen/dev/pyvenv/lib64/python3.8/site-packages/fairseq/distributed_utils.py", line 300, in distributed_main
    main(cfg, **kwargs)
  File "/home/chshen/dev/pyvenv/lib64/python3.8/site-packages/fairseq_cli/train.py", line 69, in main
    task.load_dataset(valid_sub_split, combine=False, epoch=1)
  File "/home/chshen/dev/projects/src/ml/cliff_summ/models/bart/contrastive_translation_multi_neg.py", line 353, in load_dataset
    self.datasets[split] = load_langpair_dataset(
  File "/home/chshen/dev/projects/src/ml/cliff_summ/models/bart/contrastive_translation_multi_neg.py", line 127, in load_langpair_dataset
    max_source_positions - (2 if old else 1),
NameError: name 'old' is not defined