allennlp.service.server_flask

A Flask server that serves up AllenNLP models as well as our demo.

Usually you would use serve rather than instantiating an app yourself.

exception allennlp.service.server_flask.ServerError(message, status_code=None, payload=None)[source]

Bases: Exception

status_code = 400
to_dict()[source]
allennlp.service.server_flask.make_app(build_dir: str = None, demo_db: typing.Union[allennlp.service.db.DemoDatabase, NoneType] = None) → flask.app.Flask[source]
allennlp.service.server_flask.run(port: int, trained_models: typing.Dict[str, allennlp.service.predictors.predictor.DemoModel], static_dir: str = None) → None[source]

Run the server programatically