You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running your code, I encounter some issues, and sometimes it results in the following bug. Could you please help me resolve it? Thank you!
Traceback (most recent call last):
File "DRAGIN_simplified/src/main.py", line 90, in
main()
File "DRAGIN_simplified/src/main.py", line 76, in main
pred = model.inference(entry["question"], entry["demo"], entry["case"])
File "DRAGIN_simplified/src/generate.py", line 433, in inference
outputs = self.generator.generate(
File "DRAGIN_simplified/src/generate.py", line 240, in generate
atten = torch.stack([atten[l:r, :].mean(dim=-2) for l, r in range_], dim=-2) # 同组的注意者(token),对同一被注意者(word)的attention取平均
RuntimeError: stack expects a non-empty TensorList
The text was updated successfully, but these errors were encountered:
It seems that the list range_ is empty, which means the new generated tokens are empty (after deleting the last eos_token). Check if the program enters the branch in line 214 and the list tokens become empty.
if ended:
tokens = tokens[:-1]
# 注:如果tokens中有"</s>"("<s>"也一样),转换成字符串后仍然会保留。因此在这里删掉。
When the situation occurs, you may return the GeneratorOutput instance immediately (see the format as line 267). Remember to set ended as True.
When running your code, I encounter some issues, and sometimes it results in the following bug. Could you please help me resolve it? Thank you!
Traceback (most recent call last):
File "DRAGIN_simplified/src/main.py", line 90, in
main()
File "DRAGIN_simplified/src/main.py", line 76, in main
pred = model.inference(entry["question"], entry["demo"], entry["case"])
File "DRAGIN_simplified/src/generate.py", line 433, in inference
outputs = self.generator.generate(
File "DRAGIN_simplified/src/generate.py", line 240, in generate
atten = torch.stack([atten[l:r, :].mean(dim=-2) for l, r in range_], dim=-2) # 同组的注意者(token),对同一被注意者(word)的attention取平均
RuntimeError: stack expects a non-empty TensorList
The text was updated successfully, but these errors were encountered: