Skip to content

Commit 2a6000f

Browse files
dependabot[bot]Bordapre-commit-ci[bot]
authored
build(deps): update transformers requirement from <4.52,>=4.51.3 to >=4.51.3,<4.54 (#2084)
Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jirka B <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jirka Borovec <[email protected]>
1 parent dc5c26a commit 2a6000f

File tree

5 files changed

+13
-8
lines changed

5 files changed

+13
-8
lines changed

.github/workflows/cpu-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ jobs:
8080
os: ["ubuntu-22.04"]
8181
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
8282
include:
83-
- { os: "macOS-14", python-version: "3.9" }
84-
- { os: "windows-2022", python-version: "3.9" }
83+
- { os: "macOS-14", python-version: "3.10" }
84+
- { os: "windows-2022", python-version: "3.10" }
8585
timeout-minutes: 35
8686
steps:
8787
- name: Checkout generic

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ optional-dependencies.extra = [
6565
# litgpt.pretrain:
6666
"tensorboard>=2.14",
6767
"torchmetrics>=1.3.1",
68-
"transformers>=4.51.3,<4.52",
68+
"transformers>=4.51.3,<4.54",
6969
# litdata, only on non-Windows:
7070
"uvloop>=0.2; sys_platform!='win32'",
7171
# litgpt.data.prepare_slimpajama.py:

tests/test_adapter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ def test_against_original_gemma_2(model_name, device, dtype):
359359
assert x.size(1) == T
360360
ours_y = ours_model(x)
361361
theirs_y = theirs_model(x)["logits"].to(dtype) # HF converts logits to float
362-
torch.testing.assert_close(ours_y, theirs_y)
362+
torch.testing.assert_close(ours_y, theirs_y, atol=1e-4, rtol=1e-5)
363363

364364

365365
@torch.inference_mode()
@@ -430,7 +430,7 @@ def test_against_original_gemma_3(model_name, device, dtype):
430430
assert x.size(1) == T
431431
ours_y = ours_model(x)
432432
theirs_y = theirs_model(x)["logits"].to(dtype) # HF converts logits to float
433-
torch.testing.assert_close(ours_y, theirs_y)
433+
torch.testing.assert_close(ours_y, theirs_y, atol=1e-4, rtol=1e-5)
434434

435435

436436
def test_load_legacy_state_dict():

tests/test_adapter_v2.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,8 +313,12 @@ def test_against_original_gemma_2(model_name):
313313
ours_y = ours_model(x)
314314
theirs_y = theirs_model(x)["logits"].to(dtype) # HF converts logits to float
315315
torch.testing.assert_close(
316-
ours_y, theirs_y, rtol=3e-5, atol=3e-5
317-
) # some macOS devices have numerical differences, hence the tol bump
316+
# some macOS devices have numerical differences, hence the tol bump
317+
ours_y,
318+
theirs_y,
319+
atol=1e-4,
320+
rtol=1e-5,
321+
)
318322

319323

320324
@torch.inference_mode()

tests/test_lora.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,10 +685,11 @@ def test_against_original_gemma_2(model_name):
685685
assert x.size(1) == T
686686
ours_y = ours_model(x)
687687
theirs_y = theirs_model(x)["logits"].to(dtype) # HF converts logits to float
688-
torch.testing.assert_close(ours_y, theirs_y, rtol=3e-5, atol=3e-5)
688+
torch.testing.assert_close(ours_y, theirs_y, atol=1e-4, rtol=1e-5)
689689

690690

691691
@torch.inference_mode()
692+
@pytest.mark.flaky(reruns=3)
692693
@pytest.mark.parametrize("model_name", ("gemma-3-1b-it", "gemma-3-4b-it", "gemma-3-12b-it", "gemma-3-27b-it"))
693694
def test_against_original_gemma_3(model_name):
694695
device = torch.device("cpu")

0 commit comments

Comments
 (0)