Skip to content

Commit

Permalink
Merge pull request #22 from el-tocino/Issue-19
Browse files Browse the repository at this point in the history
issue 19 fix, add ip as a parameter
  • Loading branch information
LearnedVector authored Oct 10, 2018
2 parents f18097a + 5684b00 commit 00b92b5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions demo_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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(
Expand All @@ -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)

0 comments on commit 00b92b5

Please sign in to comment.