Skip to content

Commit 20a491c

Browse files
ChenhanYuclaude
andcommitted
fix: rename make_eagle_supervised_data_module in offline test
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Chenhan Yu <chenhany@nvidia.com>
1 parent 05f6487 commit 20a491c

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

tests/unit/torch/speculative/plugins/test_hf_speculative_offline.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
assert _spec is not None and _spec.loader is not None
5555
_eagle_utils = importlib.util.module_from_spec(_spec)
5656
_spec.loader.exec_module(_eagle_utils)
57-
make_eagle_supervised_data_module = _eagle_utils.make_eagle_supervised_data_module
57+
make_speculative_data_module = _eagle_utils.make_speculative_data_module
5858

5959

6060
# ---------------------------------------------------------------------------
@@ -79,15 +79,15 @@ def test_sample_size_positive_truncates(tmp_path):
7979
"""sample_size > 0 should truncate the dataset to that many samples."""
8080
data_args = _make_data_args(sample_size=3, tmp_path=tmp_path, n_files=5)
8181
tokenizer = MagicMock()
82-
module = make_eagle_supervised_data_module(tokenizer, data_args, train_len=8)
82+
module = make_speculative_data_module(tokenizer, data_args, train_len=8)
8383
assert len(module["train_dataset"]) == 3
8484

8585

8686
def test_sample_size_minus_one_uses_all(tmp_path):
8787
"""sample_size=-1 should use all samples."""
8888
data_args = _make_data_args(sample_size=-1, tmp_path=tmp_path, n_files=5)
8989
tokenizer = MagicMock()
90-
module = make_eagle_supervised_data_module(tokenizer, data_args, train_len=8)
90+
module = make_speculative_data_module(tokenizer, data_args, train_len=8)
9191
assert len(module["train_dataset"]) == 5
9292

9393

@@ -96,14 +96,14 @@ def test_sample_size_zero_raises(tmp_path):
9696
data_args = _make_data_args(sample_size=0, tmp_path=tmp_path, n_files=5)
9797
tokenizer = MagicMock()
9898
with pytest.raises(ValueError, match="sample_size must be -1"):
99-
make_eagle_supervised_data_module(tokenizer, data_args, train_len=8)
99+
make_speculative_data_module(tokenizer, data_args, train_len=8)
100100

101101

102102
def test_sample_size_larger_than_dataset_uses_all(tmp_path):
103103
"""sample_size > number of files should use all samples without error."""
104104
data_args = _make_data_args(sample_size=100, tmp_path=tmp_path, n_files=5)
105105
tokenizer = MagicMock()
106-
module = make_eagle_supervised_data_module(tokenizer, data_args, train_len=8)
106+
module = make_speculative_data_module(tokenizer, data_args, train_len=8)
107107
assert len(module["train_dataset"]) == 5
108108

109109

@@ -118,7 +118,7 @@ def test_sample_size_no_pt_files_raises(tmp_path):
118118
)
119119
tokenizer = MagicMock()
120120
with pytest.raises(ValueError, match="No .pt files found"):
121-
make_eagle_supervised_data_module(tokenizer, data_args, train_len=8)
121+
make_speculative_data_module(tokenizer, data_args, train_len=8)
122122

123123

124124
# ---------------------------------------------------------------------------

0 commit comments

Comments
 (0)