From 7d32579384008c4939f7a91c9cbe06810685cb45 Mon Sep 17 00:00:00 2001 From: P01son6415 Date: Wed, 21 Aug 2019 17:19:20 +0800 Subject: [PATCH] modify mode of open() to 'wb' --- ernie_encoder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ernie_encoder.py b/ernie_encoder.py index 56be900c..f2dd1b2b 100644 --- a/ernie_encoder.py +++ b/ernie_encoder.py @@ -170,10 +170,10 @@ def main(args): total_top_layer_emb = np.concatenate(total_top_layer_emb) with open(os.path.join(args.output_dir, "cls_emb.npy"), - "w") as cls_emb_file: + "wb") as cls_emb_file: np.save(cls_emb_file, total_cls_emb) with open(os.path.join(args.output_dir, "top_layer_emb.npy"), - "w") as top_layer_emb_file: + "wb") as top_layer_emb_file: np.save(top_layer_emb_file, total_top_layer_emb)