allennlp.service.server_sanic

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

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

allennlp.service.server_sanic.make_app(build_dir: str = None, demo_db: typing.Union[allennlp.service.db.DemoDatabase, NoneType] = None) → sanic.app.Sanic[source]
allennlp.service.server_sanic.run(port: int, workers: int, trained_models: typing.Dict[str, allennlp.service.predictors.predictor.DemoModel], static_dir: str = None) → None[source]

Run the server programatically