Skip to content

Commit

Permalink
fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
eegli committed Feb 11, 2025
1 parent caa93fc commit 998e6cd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/unit/model/test_mblm.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import torch

from mblm import MBLM, MBLMModelConfig, MBLMReturnType, TransformerBlock
from mblm.utils.seed import seed_everything
from mblm.utils.stream import ByteStreamer


Expand Down Expand Up @@ -68,6 +69,8 @@ def test_masked_loss(

def test_generate(self):
ctx_windows = [12, 4]

seed_everything(8)
mblm = MBLM(
MBLMModelConfig(
num_tokens=self.num_tokens,
Expand Down Expand Up @@ -102,6 +105,6 @@ def test_generate(self):

buff = io.BytesIO()
with ByteStreamer(buff) as stream:
generate(stream=stream)
generate(stream=stream, filter_thres=1)

assert len(buff.getbuffer()) == total_generation_len

0 comments on commit 998e6cd

Please sign in to comment.