Skip to content

Commit

Permalink
Fix pytype error and use default rng when seed is None.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 657578299
Change-Id: I9102a1c8c2207358c1ecbaff7b9ce026a104a949
  • Loading branch information
jagapiou authored and copybara-github committed Jul 30, 2024
1 parent e3bd814 commit c1f0291
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions concordia/associative_memory/associative_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

from collections.abc import Callable, Iterable, Sequence
import datetime
import random
import threading

from concordia.associative_memory import importance_function
Expand Down Expand Up @@ -62,14 +61,11 @@ def __init__(
clock: a callable to get time when adding memories
clock_step_size: sets the step size of the clock. If None, assumes precise
time
seed: the seed to use for the random number generator if None then use the
current time
seed: optional seed to use for the random number generator. If None, uses
the default rng.
"""
self._memory_bank_lock = threading.Lock()
if seed is None:
self._seed = random.seed(int(datetime.datetime.now().timestamp()))
else:
self._seed = seed
self._seed = seed
self._embedder = sentence_embedder
self._num_to_retrieve_to_contextualize_importance = (
_NUM_TO_RETRIEVE_TO_CONTEXTUALIZE_IMPORTANCE)
Expand Down

0 comments on commit c1f0291

Please sign in to comment.