Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Commit

Permalink
Prevent from changing the interface specification once set.
Browse files Browse the repository at this point in the history
Summary: Prevent from changing the interface specification once set.

Differential Revision: D23502188

fbshipit-source-id: dbf5b28c220ec9845c010576e923e2369a2f4392
  • Loading branch information
Michael Gschwind authored and facebook-github-bot committed Sep 3, 2020
1 parent a78effd commit 9ef7bf2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pytext/torchscript/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@ def inference_interface(self, argument_type: str):
# LANGUAGES = 3
# DENSE_FEAT = 4

if self.argno != -1:
raise RuntimeError("Cannot change argument type.")
if argument_type == "texts":
self.argno = TEXTS
else:
Expand Down

0 comments on commit 9ef7bf2

Please sign in to comment.