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

SERAC Edit Limits #462

Open
shariqahn opened this issue Dec 27, 2024 · 0 comments
Open

SERAC Edit Limits #462

shariqahn opened this issue Dec 27, 2024 · 0 comments
Labels
question Further information is requested

Comments

@shariqahn
Copy link

shariqahn commented Dec 27, 2024

I got the following error when trying to train SERAC:

Traceback (most recent call last):
  File "/EasyEdit/serac_train.py", line 16, in <module>
    trainer.run()
  File "/EasyEdit/easyeditor/trainer/BaseTrainer.py", line 195, in run
    train_info = self.train_step(batch)
  File "/EasyEdit/easyeditor/trainer/EditTrainer.py", line 141, in train_step
    l_total, l_edit, l_loc, l_base, info_dict = self.edit_step(
  File "/EasyEdit/easyeditor/trainer/EditTrainer.py", line 54, in edit_step
    l_edit = self.model.edit_loss_fn(
  File "/EasyEdit/easyeditor/trainer/algs/editable_model.py", line 24, in _edit_loss_fn
    return masked_log_probs(config, pred, targ, shift=True, **kwargs)
  File "/EasyEdit/easyeditor/trainer/losses.py", line 135, in masked_log_probs
    return multiclass_log_probs(config, pred, targ, shift=shift, exact_match=exact_match, **kwargs)
  File "/EasyEdit/easyeditor/trainer/losses.py", line 70, in multiclass_log_probs
    unmasked_log_probs = pred.log_softmax(-1).gather(-1, targ.unsqueeze(-1)).squeeze(-1)
RuntimeError: Size does not match at dimension 1 expected index [10, 32, 1] to be smaller than self [10, 31, 32000] apart from dimension 2

I have run the training successfully on a different dataset that had shorter strings for the new target. Is there a limit to how long the new target should be? If so, do you have suggestions on how to handle this? For example, would it be okay to provide a simplified version of the edits that are within the limit for training but provide the full string for edits?

@zxlzr zxlzr added the question Further information is requested label Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants