From 1682ea7dec8bcf6fb9bc6c26fc6a915a8dc0ba8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A1=8C=E5=97=94?= Date: Mon, 24 Oct 2022 18:07:18 +0800 Subject: [PATCH] fix local path --- tests/trainers/test_ofa_trainer.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/trainers/test_ofa_trainer.py b/tests/trainers/test_ofa_trainer.py index fe7672df..f21cb3da 100644 --- a/tests/trainers/test_ofa_trainer.py +++ b/tests/trainers/test_ofa_trainer.py @@ -1,7 +1,5 @@ # Copyright (c) Alibaba, Inc. and its affiliates. -import glob import os -import os.path as osp import shutil import unittest @@ -54,7 +52,7 @@ class TestOfaTrainer(unittest.TestCase): 'drop_worst_ratio': 0.0, 'ignore_eos': False, 'ignore_prefix_size': 0, - 'label_smoothing': 0.0, + 'label_smoothing': 0.1, 'reg_alpha': 1.0, 'report_accuracy': False, 'sample_patch_num': 196, @@ -77,11 +75,11 @@ class TestOfaTrainer(unittest.TestCase): def test_trainer_std(self): WORKSPACE = './workspace/ckpts/caption' os.makedirs(WORKSPACE, exist_ok=True) - config_file = os.path.join(WORKSPACE, 'configuration.json') + config_file = os.path.join(WORKSPACE, ModelFile.CONFIGURATION) with open(config_file, 'w') as writer: json.dump(self.finetune_cfg, writer) - pretrained_model = '/apsarapangu/disk2/yichang.zyc/ckpt/MaaS/ofa_image-caption_coco_large_en' + pretrained_model = 'damo/ofa_image-caption_coco_large_en' args = dict( model=pretrained_model, work_dir=WORKSPACE,