We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
RoFormer_pytorch/src/roformer/modeling_roformer.py
Line 1465 in 447aa8f
The text was updated successfully, but these errors were encountered:
No branches or pull requests
RoFormer_pytorch/src/roformer/modeling_roformer.py
Line 1465 in 447aa8f
transformers模型的generate方法代码中,上文状态的参数名为past_key_values,不是past;
以transformers.GenerationMixin.sample方法为例,在其主循环while True中,在上一循环末尾会调用self._update_model_kwargs_for_generation 更新model_kwargs,此时更新进去的参数名为past_key_values;但到了下一循环调用self.prepare_inputs_for_generation时,又要从model_kwargs中取past参数,从而取不到,导致重复计算(基于更新了的input_ids重新算一遍上文状态),并且token_type_ids会一直取0,而不是预期的在生成第一个token时取0,此后一直取1。
The text was updated successfully, but these errors were encountered: