Skip to content

Commit

Permalink
Read sentences from file
Browse files Browse the repository at this point in the history
Signed-off-by: begeekmyfriend <[email protected]>
  • Loading branch information
begeekmyfriend committed Jun 13, 2019
1 parent 4de3de5 commit 3ef7e36
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions synthesize.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,14 @@ def prepare_run(args):

def get_sentences(args):
if args.text_list != '':
with open(args.text_list, 'rb') as f:
sentences = list(map(lambda l: l.decode("utf-8")[:-1], f.readlines()))
with open(args.text_list) as f:
#sentences = list(map(lambda l: l.decode("utf-8")[:-1], f.readlines()))
i = 0
sentences = []
for line in f.readlines():
i += 1
if i % 2 == 0:
sentences.append(line.strip())
else:
sentences = hparams.sentences
return sentences
Expand Down

0 comments on commit 3ef7e36

Please sign in to comment.