未验证 提交 c5901232 编写于 作者: C Chang Xu 提交者: GitHub

Copy Json to SaveDir in NLP Demo (#1252)

上级 072ff7a0
......@@ -4,6 +4,7 @@ import argparse
import functools
from functools import partial
import numpy as np
import shutil
import paddle
import paddle.nn as nn
from paddle.io import Dataset, BatchSampler, DataLoader
......@@ -305,13 +306,17 @@ def main():
if 'HyperParameterOptimization' not in all_config else eval_dataloader,
eval_dataloader=eval_dataloader)
ac.compress()
if not os.path.exists(args.save_dir):
os.makedirs(args.save_dir)
for file_name in os.listdir(global_config['model_dir']):
if 'json' in file_name or 'txt' in file_name:
shutil.copy(
os.path.join(global_config['model_dir'], file_name),
args.save_dir)
ac.compress()
if __name__ == '__main__':
paddle.enable_static()
......
......@@ -363,7 +363,8 @@ def main():
'HyperParameterOptimization' not in all_config else eval_dataloader,
eval_dataloader=eval_dataloader)
ac.compress()
if not os.path.exists(args.save_dir):
os.makedirs(args.save_dir)
for file_name in os.listdir(global_config['model_dir']):
if 'json' in file_name or 'txt' in file_name:
......@@ -371,6 +372,8 @@ def main():
os.path.join(global_config['model_dir'], file_name),
args.save_dir)
ac.compress()
if __name__ == '__main__':
paddle.enable_static()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册