From 5684b001691408e567c6fd89a8cd2a1fd413d15a Mon Sep 17 00:00:00 2001 From: el-tocino Date: Wed, 10 Oct 2018 15:39:03 -0500 Subject: [PATCH] issue 19 fix, add ip as a parameter --- demo_server.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/demo_server.py b/demo_server.py index 4ba3918..2ed800c 100644 --- a/demo_server.py +++ b/demo_server.py @@ -81,7 +81,8 @@ def get(self): return send_file(audio, mimetype="audio/wav") else: wav, _ = synthesizer.synthesize(text) - return send_file(wav, mimetype="audio/wav") + audio = io.BytesIO(wav) + return send_file(audio, mimetype="audio/wav") class UI(MethodView): @@ -101,6 +102,7 @@ def get(self): parser.add_argument('--checkpoint', required=True, help='Full path to model checkpoint') parser.add_argument('--port', type=int, default=3000) + parser.add_argument('--ip', type=str, default='0.0.0.0') parser.add_argument('--hparams', default='', help='Hyperparameter overrides as a comma-separated list of name=value pairs') parser.add_argument( @@ -119,4 +121,4 @@ def get(self): hparams.parse(args.hparams) print(hparams_debug_string()) synthesizer.load(args.checkpoint) - app.run(host='0.0.0.0', port=args.port) + app.run(host=args.ip, port=args.port)