Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

Commit 2154e72

Browse files
HarshTrivedijoelgrus
authored andcommitted
Allow server start without field-names. (#1523)
* Allow server start without field-names. * Allow server to turn ON w/o field-name, static_dir * Fix a typo.
1 parent e32f486 commit 2154e72

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

allennlp/service/server_simple.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ def make_app(predictor: Predictor,
7878
logger.error("app directory %s does not exist, aborting", static_dir)
7979
sys.exit(-1)
8080
elif static_dir is None and field_names is None:
81-
logger.error("must specify either build_dir or field_names")
82-
sys.exit(-1)
81+
print("Neither build_dir nor field_names passed. Demo won't render on this port.\n"
82+
"You must use nodejs + react app to interact with the server.")
8383

8484
app = Flask(__name__) # pylint: disable=invalid-name
8585

@@ -135,7 +135,7 @@ def main(args):
135135
parser.add_argument('--predictor', type=str, required=True, help='name of predictor')
136136
parser.add_argument('--static-dir', type=str, help='serve index.html from this directory')
137137
parser.add_argument('--title', type=str, help='change the default page title', default="AllenNLP Demo")
138-
parser.add_argument('--field-name', type=str, required=True, action='append',
138+
parser.add_argument('--field-name', type=str, action='append',
139139
help='field names to include in the demo')
140140
parser.add_argument('--port', type=int, default=8000, help='port to serve the demo on')
141141

0 commit comments

Comments
 (0)