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: b21a8e53bb265a001e7a2772afee64a10e3d2c6e
  • Loading branch information
Michael Gschwind authored and facebook-github-bot committed Sep 3, 2020
1 parent e413df4 commit c9b04a5
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 c9b04a5

Please sign in to comment.