Closed puraminy closed 2 years ago
Hi,
Yes, another bug when setting knowledge_usage to separate. I tried to fix it in the latest commit.
I applied the changes in commit, but I get the error in training:
1779, in training_step
loss = self.compute_loss(model, inputs)
File "/home/pouramini/anaconda3/lib/python3.9/site-packages/transformers/trainer.py", line 1811, in compute_loss
outputs = model(**inputs)
File "/home/pouramini/anaconda3/lib/python3.9/site-packages/torch/nn/modules/module.py", line 1102, in _call_impl
return forward_call(*input, **kwargs)
File "/home/pouramini/mt5-comet/comet/models/unified/prefixtuning.py", line 268, in forward
past_prompt = self.get_prompt(
File "/home/pouramini/mt5-comet/comet/models/unified/prefixtuning.py", line 123, in get_prompt
past_key_values = torch.cat([past_key_values, self.knowledge_trans(knowledge.repeat_interleave(sample_size, dim=0).unsqueeze(1))], dim=1)
RuntimeError: Tensors must have same number of dimensions: got 3 and 4
Did you try it yourself?
Thanks, now it works, I also removed unsqueeze
part
Great!
Thanks, now it's working!
Yea I just ran it on my server, and it also works. Thanks for pointing out this issue!
For the evaluation, I receive the following error:
It seems when you use
num_beam
greater than 1 and it's used assample_size
inget_prompt
method and is multiplied to batch_size, the mismatch occurs.