diff --git a/gpt_2_simple/gpt_2.py b/gpt_2_simple/gpt_2.py index 37297a2..9b48549 100644 --- a/gpt_2_simple/gpt_2.py +++ b/gpt_2_simple/gpt_2.py @@ -302,7 +302,7 @@ def generate_samples(): maketree(os.path.join(SAMPLE_DIR, run_name)) with open( os.path.join(SAMPLE_DIR, run_name, - 'samples-{}').format(counter), 'w') as fp: + 'samples-{}').format(counter), 'w', encoding='utf-8') as fp: fp.write('\n'.join(all_text)) def sample_batch(): @@ -465,7 +465,7 @@ def generate(sess, )[:, 1:] if destination_path: - f = open(destination_path, 'w') + f = open(destination_path, 'w', encoding='utf-8') generated = 0 gen_texts = [] while generated < nsamples: