Skip to content

Commit b38b3f5

Browse files
authored
Fix mutable default is not allowed error (#171)
Fix mutable default is not allowed error in py3.11 b/c py3.11 enforce the behavior that mutable default is not allowed in dataclass.
1 parent a49c0a4 commit b38b3f5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

jetstream/core/orchestrator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ class ActiveRequest:
156156
generate_timestep_added: Optional[int] = None
157157
is_client_side_tokenization: Optional[bool] = False
158158
################## Information relevant for metrics ###################
159-
metadata: ActiveRequestMetadata = ActiveRequestMetadata()
159+
metadata: ActiveRequestMetadata = dataclasses.field(
160+
default_factory=ActiveRequestMetadata
161+
)
160162

161163
def enqueue_samples(self, generated_samples: list[ReturnSample]):
162164
"""Adds the generated sample(s) to return channel for current step.

0 commit comments

Comments
 (0)