Fix an error introduced while supporting torchscript.

Should be `G.dummy = 1`, not `G["dummy"] = 1`.
This commit is contained in:
Fangjun Kuang 2021-11-27 09:02:16 +08:00
parent 769a9791ec
commit 277654249d

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: