Skip to content

Commit

Permalink
fix the seed to the settings
Browse files Browse the repository at this point in the history
Signed-off-by: Elron Bandel <elron.bandel@ibm.com>
  • Loading branch information
elronbandel committed Mar 17, 2024
1 parent c9542b3 commit 0003944
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/library/test_random_utils.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import random as python_random

from src.unitxt.random_utils import (
__default_seed__,
new_random_generator,
)
from src.unitxt.settings_utils import get_settings
from tests.utils import UnitxtTestCase

settings = get_settings()


def randomize(sub_seed: str):
random_generator = new_random_generator(sub_seed=sub_seed)
Expand All @@ -18,7 +20,7 @@ class TestRandomUtils(UnitxtTestCase):
def test_default_seed(self):
a = randomize(sub_seed="42")
b = randomize(sub_seed="43")
c = randomize(sub_seed=str(__default_seed__))
c = randomize(sub_seed=str(settings.seed))
self.assertNotEqual(a, b)
self.assertEqual(a, c)

Expand Down

0 comments on commit 0003944

Please sign in to comment.