Skip to content

Fix backwards compatibility of vocab serialization #591

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

Merged
merged 3 commits into from
Aug 20, 2019

Conversation

mttk
Copy link
Contributor

@mttk mttk commented Aug 20, 2019

(Hopefully) fixes the issue mentioned in #531, after the PR was merged.

Previous instances of "Vocab" didn't have the "unk_index" attribute, which the deserialization wrongly assumes will be present. This is causing issues when loading models stored with previous versions of torchtext. I added a bandaid fix as well as a test checking whether loading works on a mocked older version of the Vocab instance.

@francoishernandez I would appreciate if you can test the patch once it's merged.

@mttk mttk requested a review from zhangguanheng66 August 20, 2019 13:21
@francoishernandez
Copy link

Just installed from your branch, seems to work fine, thanks!

@zhangguanheng66 zhangguanheng66 merged commit 7de812b into pytorch:master Aug 20, 2019
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.

3 participants