From a7b4ce89f1241cdea28d0cc29370dfaa04f95295 Mon Sep 17 00:00:00 2001 From: Tyler Date: Thu, 20 Jul 2023 10:36:19 -0700 Subject: [PATCH] fixed adding cache argument to certain algorithms (#471) --- src/autolabel/few_shot/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/autolabel/few_shot/__init__.py b/src/autolabel/few_shot/__init__.py index 028a78d6..01ad1317 100644 --- a/src/autolabel/few_shot/__init__.py +++ b/src/autolabel/few_shot/__init__.py @@ -104,6 +104,10 @@ def initialize_selector( example_cls = ALGORITHM_TO_IMPLEMENTATION[algorithm] - params["cache"] = cache + if algorithm not in [ + FewShotAlgorithm.FIXED, + FewShotAlgorithm.LABEL_DIVERSITY_RANDOM, + ]: + params["cache"] = cache return example_cls.from_examples(**params)