diff --git a/pytext/torchscript/module.py b/pytext/torchscript/module.py index a431c8d21..bcc98a067 100644 --- a/pytext/torchscript/module.py +++ b/pytext/torchscript/module.py @@ -150,6 +150,8 @@ def inference_interface(self, argument_type: str): # LANGUAGES = 3 # DENSE_FEAT = 4 + if (sel.argno != -1): + raise RuntimeError("Cannot change argument type.") if argument_type == "texts": self.argno = TEXTS else: