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

transformers version #1

Open
wangjian026 opened this issue Nov 17, 2021 · 9 comments
Open

transformers version #1

wangjian026 opened this issue Nov 17, 2021 · 9 comments

Comments

@wangjian026
Copy link

hello,i use the transformers(v3.0.2),and got multiple error "unresolved reference" in modeling_bart.py. if i use higher version of transformers(v3.1.0), the above error disappears,However, at running time,since there are great differences between the two versions, there is something wrong occur in function "prepare_inputs_for_generation()" in modeling_bart.py.

@elevenofji
Copy link

not only the "prepare_inputs_for_generation", in lighting_base.py, "Adafactor" and "get_polynomial_decay_schedule_with_warmup" cannot be imported correctly.I'm just trying to find a solution

@wangjian026
Copy link
Author

use transformers(v3.2.0), and change the code"encoder_outputs, decoder_past_key_values = past" of function"prepare_inputs_for_generation" in lighting_base.py to "encoder_outputs, decoder_past_key_values = (kwargs['encoder_outputs'],None)" may solve this problem.

@elevenofji
Copy link

elevenofji commented Nov 23, 2021

use transformers(v3.2.0), and change the code"encoder_outputs, decoder_past_key_values = past" of function"prepare_inputs_for_generation" in lighting_base.py to "encoder_outputs, decoder_past_key_values = (kwargs['encoder_outputs'],None)" may solve this problem.

GOOD idea. And I think sth about decoder_past_key_values, such as "decoder_past_key_values = outputs.decoder_past_key_values," in modeling_bart should be removed too.

BTW, have you tried the model with answer_relevance_score? I just found that it depends on another paper and there's a ckpt too. (https://github.com/HLTCHKUST/HLTC-MRQA)

@Iamfinethanksu
Copy link
Member

Thank you for the discussion. Actually, our transformer's version for the experiment is a little bit twisted between the two version, for some historical issue. You may choose v3.0.2 and modify some function (input, or output ) accordingly, then it should be fine.

@elevenofji
Copy link

elevenofji commented Nov 29, 2021

@Iamfinethanksu Yeah,u r right. The transformer's version has to be 3.0.2, and there're so many differences in the "input" and "output" between 3.0.2 and 3.2.0. I cannot get an expected result in 3.2.0 (even cannot get a normal decoding sentence, the reason may be that @wangjian026 solution may ignore the "decoder_past_key_values" directly. ). After fixing the transformer's version to 3.0.2 and changing some funcs, it works. I'll push the changed code to my repos.

Here are 10 hours fine-tuning results (without mrc's score).
1638170521(1)

Here are paper's res:
image

The reason may be that the model takes "rouge2" as a val-metric.

@Iamfinethanksu Maybe you can emphasize the problem in README.md. (Also, the paper pdf link in README.md is wrong, linking to your another paper in emnlp19 XD).
Thx for @Iamfinethanksu and @wangjian026 's help.

@wangjian026
Copy link
Author

@Iamfinethanksu Yeah,u r right. The transformer's version has to be 3.0.2, and there're so many differences in the "input" and "output" between 3.0.2 and 3.2.0. I cannot get an expected result in 3.2.0 (even cannot get a normal decoding sentence, the reason may be that @wangjian026 solution may ignore the "decoder_past_key_values" directly. ). After fixing the transformer's version to 3.0.2 and changing some funcs, it works. I'll push the changed code to my repos.

Here are 10 hours fine-tuning results (without mrc's score). 1638170521(1)

Here are paper's res: image

The reason may be that the model takes "rouge2" as a val-metric.

@Iamfinethanksu Maybe you can emphasize the problem in README.md. (Also, the paper pdf link in README.md is wrong, linking to your another paper in emnlp19 XD). Thx for @Iamfinethanksu and @wangjian026 's help.

GOOD idea!I have been trying to get a better result, but I failed. Could you send me the modified codes with transformer's version 3.0.2 ? Thanks again.Thanks again, my email: [email protected]

@elevenofji
Copy link

@Iamfinethanksu Yeah,u r right. The transformer's version has to be 3.0.2, and there're so many differences in the "input" and "output" between 3.0.2 and 3.2.0. I cannot get an expected result in 3.2.0 (even cannot get a normal decoding sentence, the reason may be that @wangjian026 solution may ignore the "decoder_past_key_values" directly. ). After fixing the transformer's version to 3.0.2 and changing some funcs, it works. I'll push the changed code to my repos.
Here are 10 hours fine-tuning results (without mrc's score). 1638170521(1)
Here are paper's res: image
The reason may be that the model takes "rouge2" as a val-metric.
@Iamfinethanksu Maybe you can emphasize the problem in README.md. (Also, the paper pdf link in README.md is wrong, linking to your another paper in emnlp19 XD). Thx for @Iamfinethanksu and @wangjian026 's help.

GOOD idea!I have been trying to get a better result, but I failed. Could you send me the modified codes with transformer's version 3.0.2 ? Thanks again.Thanks again, my email: [email protected]

you can just download in https://github.com/elevenofji/bart_test.

@wangjian026
Copy link
Author

@Iamfinethanksu Yeah,u r right. The transformer's version has to be 3.0.2, and there're so many differences in the "input" and "output" between 3.0.2 and 3.2.0. I cannot get an expected result in 3.2.0 (even cannot get a normal decoding sentence, the reason may be that @wangjian026 solution may ignore the "decoder_past_key_values" directly. ). After fixing the transformer's version to 3.0.2 and changing some funcs, it works. I'll push the changed code to my repos.
Here are 10 hours fine-tuning results (without mrc's score). 1638170521(1)
Here are paper's res: image
The reason may be that the model takes "rouge2" as a val-metric.
@Iamfinethanksu Maybe you can emphasize the problem in README.md. (Also, the paper pdf link in README.md is wrong, linking to your another paper in emnlp19 XD). Thx for @Iamfinethanksu and @wangjian026 's help.

GOOD idea!I have been trying to get a better result, but I failed. Could you send me the modified codes with transformer's version 3.0.2 ? Thanks again.Thanks again, my email: [email protected]

you can just download in https://github.com/elevenofji/bart_test.

Thank you very much for your work, I have downloaded the code, however, a file named modeling_bart seems to have been lost in the src file

@elevenofji
Copy link

elevenofji commented Dec 2, 2021

@Iamfinethanksu Yeah,u r right. The transformer's version has to be 3.0.2, and there're so many differences in the "input" and "output" between 3.0.2 and 3.2.0. I cannot get an expected result in 3.2.0 (even cannot get a normal decoding sentence, the reason may be that @wangjian026 solution may ignore the "decoder_past_key_values" directly. ). After fixing the transformer's version to 3.0.2 and changing some funcs, it works. I'll push the changed code to my repos.
Here are 10 hours fine-tuning results (without mrc's score). 1638170521(1)
Here are paper's res: image
The reason may be that the model takes "rouge2" as a val-metric.
@Iamfinethanksu Maybe you can emphasize the problem in README.md. (Also, the paper pdf link in README.md is wrong, linking to your another paper in emnlp19 XD). Thx for @Iamfinethanksu and @wangjian026 's help.

GOOD idea!I have been trying to get a better result, but I failed. Could you send me the modified codes with transformer's version 3.0.2 ? Thanks again.Thanks again, my email: [email protected]

you can just download in https://github.com/elevenofji/bart_test.

Thank you very much for your work, I have downloaded the code, however, a file named modeling_bart seems to have been lost in the src file

Sorry for that. I've fixed. Maybe we can discuss in https://github.com/elevenofji/bart_test. This issue can be closed.

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

3 participants