From 806cdd3134c4de79e9dcc716a3e515a461631e01 Mon Sep 17 00:00:00 2001 From: bxdd Date: Tue, 7 Nov 2023 15:45:45 +0800 Subject: [PATCH 1/2] [FIX] fix bugs in example --- examples/workflow_by_code/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/workflow_by_code/main.py b/examples/workflow_by_code/main.py index afedc41..39b1b6c 100644 --- a/examples/workflow_by_code/main.py +++ b/examples/workflow_by_code/main.py @@ -12,7 +12,7 @@ from shutil import copyfile, rmtree import learnware from learnware.market import EasyMarket, BaseUserInfo from learnware.reuse import JobSelectorReuser, AveragingReuser -from learnware.specification import generate_rkme_spec +from learnware.specification import generate_rkme_spec, RKMETableSpecification curr_root = os.path.dirname(os.path.abspath(__file__)) @@ -147,7 +147,7 @@ class LearnwareMarketWorkflow: with zipfile.ZipFile(zip_path, "r") as zip_obj: zip_obj.extractall(path=unzip_dir) - user_spec = specification.RKMETableSpecification() + user_spec = RKMETableSpecification() user_spec.load(os.path.join(unzip_dir, "svm.json")) user_info = BaseUserInfo(semantic_spec=user_semantic, stat_info={"RKMETableSpecification": user_spec}) ( From 4af5bd1c216ea8db5cb04d83c130b02d600f7318 Mon Sep 17 00:00:00 2001 From: bxdd Date: Tue, 7 Nov 2023 15:48:18 +0800 Subject: [PATCH 2/2] [FIX] fix typo --- learnware/market/easy2/checker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/learnware/market/easy2/checker.py b/learnware/market/easy2/checker.py index 5e15271..589f3e2 100644 --- a/learnware/market/easy2/checker.py +++ b/learnware/market/easy2/checker.py @@ -141,7 +141,7 @@ class EasyStatChecker(BaseChecker): int(semantic_spec["Output"]["Dimension"]), ): logger.warning( - f"The learnware [{learnware.id}] output dimention mismatch!, where pred_shape={outputs[0].shape}, model_shape={learnware_model.output_shape}, semantic_shape={(int(semantic_spec['Output']['Dimension']), )}" + f"The learnware [{learnware.id}] output dimension mismatch!, where pred_shape={outputs[0].shape}, model_shape={learnware_model.output_shape}, semantic_shape={(int(semantic_spec['Output']['Dimension']), )}" ) return self.INVALID_LEARNWARE