Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.

What's the usage of num_logits_to_keep? #6

Open
FuRuF-11 opened this issue Jan 14, 2025 · 1 comment
Open

What's the usage of num_logits_to_keep? #6

FuRuF-11 opened this issue Jan 14, 2025 · 1 comment

Comments

@FuRuF-11
Copy link

FuRuF-11 commented Jan 14, 2025

I was trying to run train.py with Qwen2.5 1.5B. And a error occurred.

File "/home/comp/xxxxx/miniconda3/envs/rex/lib/python3.12/site-packages/torch/amp/autocast_mode.py", line 44, in decorate_autocast
return func(args, *kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/comp/xxxxx/PathIndependent/OpenCoconut/opencoconut/models/qwen2.py", line 368, in forward
outputs = forward_fn(
^^^^^^^^^^^
File "/home/comp/xxxxx/PathIndependent/OpenCoconut/opencoconut/models/qwen2.py", line 329, in train_forward
outputs = super().forward(
^^^^^^^^^^^^^^^^
TypeError: Qwen2ForCausalLM.forward() got an unexpected keyword argument 'num_logits_to_keep'

So I just deleted num_logits_to_keep in qwen2.py. Then the program ran.

But I am still confused about the usage of num_logits_to_keep.

And I am also worried that simply delete this arg will lead to another bug.

I would be very grateful if you could relieve my confusion.

@FuRuF-11
Copy link
Author

Fixed now.

num_logits_to_keep is not available for transformers 4.40.1.

After updated my package, everything is good.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant