Fix an error introduced while supporting torchscript. (#134)

Should be `G.dummy = 1`, not `G["dummy"] = 1`.
This commit is contained in:
Fangjun Kuang 2021-11-27 09:07:04 +08:00 committed by GitHub
parent 0e541f5b5d
commit 243fb9723c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -615,7 +615,7 @@ def main():
# Save a dummy value so that it can be loaded in C++.
# See https://github.com/pytorch/pytorch/issues/67902
# for why we need to do this.
G["dummy"] = 1
G.dummy = 1
torch.save(G.as_dict(), params.lm_dir / "G_4_gram.pt")
else: