diff --git a/ernie_encoder.py b/ernie_encoder.py index 56be900c895f932c3f5b384c4585f50d8989307b..f2dd1b2b6b06ea77b8cd759868315211c6b407f4 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)