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

Verify vocab is padded before reshaping #782

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

austinleedavis
Copy link

@austinleedavis austinleedavis commented Oct 23, 2024

This change verifies the vocab is padded (i.e., V != Vp) before reshaping the wte tensor.

Otherwise, export_hf.py produces an empty wte tensor with shape [0,C] because slicing the first dimension of wte with (V-Vp) equals zero whenever V == Vp.

This change verifies the vocab is padded (i.e., if V != Vp) before reshaping the tensor.

Otherwise, when V == Vp, `w[key] = w[key].reshape(shape)[:(V-Vp), :]` produces an empty `wte` tensor with shape [0,C].
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

Successfully merging this pull request may close these issues.

1 participant