Skip to content

Commit c90534f

Browse files
authored
Fixed missing sampling_seed in DiverseLabelsSampler (#1941)
* Fixed missing sampling_seed in DiverseLabelsSampler * Downgrade dyndamic in git action to run LLM eval Signed-off-by: Yoav Katz <[email protected]> --------- Signed-off-by: Yoav Katz <[email protected]>
1 parent 6c794b7 commit c90534f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.github/actions/install-internal-pip/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ runs:
3232
fi
3333
echo "Installing from URL: $URL"
3434
pip install --no-cache-dir --force-reinstall "$URL" ${{ inputs.pip-extra-args }}
35+
echo "Downgrading pydantic as required LLM eval kit library"
36+
pip install pydantic==2.11.3
37+

src/unitxt/splitters.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,11 +312,14 @@ def sample(
312312
sample_size: int,
313313
instances_pool: List[Dict[str, object]],
314314
instance: Optional[Dict[str, object]],
315+
sampling_seed: Optional[int] = None,
315316
) -> List[Dict[str, object]]:
316317
if self.labels_cache is None:
317318
self.labels_cache = self.divide_by_repr(instances_pool)
318319
all_labels = list(self.labels_cache.keys())
319-
random_generator = get_random_generator_based_on_instance(instance)
320+
random_generator = get_random_generator_based_on_instance(
321+
instance, local_seed=sampling_seed
322+
)
320323
random_generator.shuffle(all_labels)
321324
from collections import Counter
322325

0 commit comments

Comments
 (0)