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

SimCTG BART training #27

Open
rahulseetharaman opened this issue May 6, 2023 · 0 comments
Open

SimCTG BART training #27

rahulseetharaman opened this issue May 6, 2023 · 0 comments

Comments

@rahulseetharaman
Copy link

rahulseetharaman commented May 6, 2023

Hi @yxuansu, thanks for the wonderful library

I am trying to use SimCTG framework to train a BART model for a question generation task. I am facing the following issue in trying to train a BART model with SimCTG loss.

  File "experiment-5/simctg_train.py", line 224, in <module>
    train()
  File "experiment-5/simctg_train.py", line 122, in train
    mle_loss, cl_loss = simctgloss(last_hidden_states=last_hidden_states, logits=logits,
  File "/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "simctg/lossfunction.py", line 93, in forward
    assert labels.size() == input_ids.size()
AssertionError

While looking at the loss function, I did realize why this happens. Is the loss function designed to support only decoder only models like GPT for example ? How to adapt it for BART and T5 ? For bart and t5 the assertion that input ids and labels dimensions are the same need not hold.

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

1 participant