From ad864b2ab1907bdfc7b59be432de245df11a9de4 Mon Sep 17 00:00:00 2001 From: feng lui Date: Wed, 27 Sep 2023 07:03:48 +0800 Subject: [PATCH] fix Invalid format string MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit %s 并不是 strftime 函数支持的格式化代码。 --- src/eval.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/eval.py b/src/eval.py index 1679cda..d2cc67a 100644 --- a/src/eval.py +++ b/src/eval.py @@ -46,7 +46,7 @@ def generate_prompts(p, model, tokenizer, gpu=1, prompt_length=256, answer_lengt def eval(args): base_save_dir = args.base_save_dir - datetime_str = datetime.now().strftime("%Y%m%d-%H%M-%s") + datetime_str = datetime.now().strftime("%Y%m%d-%H%M-%S") if "checkpoint" in args.model_name_or_path: model_dir, ckp = os.path.split(os.path.normpath(args.model_name_or_path)) m_str = os.path.join(os.path.basename(model_dir), ckp) @@ -163,4 +163,4 @@ def iter_prompt_list(p_list): args.sub_folder = task args.dataset_name = task.split("-")[1] args.task = task_type2task_class[task.split("-")[2]] - eval(args) \ No newline at end of file + eval(args)