Skip to content

Commit 4b84d8f

Browse files
committed
Merge chore/transformers-5 into release/v0.0.29 (test fixes)
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # uv.lock
2 parents 30374ca + 2f51531 commit 4b84d8f

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

tests/models/foundation/test_flowstate.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
1+
import sys
2+
13
import numpy as np
24
import pandas as pd
5+
import pytest
6+
7+
if sys.version_info < (3, 11) or sys.version_info >= (3, 14):
8+
pytest.skip(
9+
"FlowState requires Python >= 3.11 and < 3.14",
10+
allow_module_level=True,
11+
)
312

413
from timecopilot import TimeCopilotForecaster
514
from timecopilot.models.foundation.flowstate import FlowState

tests/models/foundation/test_timesfm.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,9 @@ def test_load_model_from_local_path(mocker, model_class, mock_paths):
4747
expected_path = os.path.join(local_path, "torch_model.ckpt")
4848
mock_loader[0].assert_called_once_with(path=expected_path)
4949
elif model_class is _TimesFMV2_p5:
50-
expected_predictor = mock_loader[
51-
0
52-
].return_value.model.load_checkpoint.return_value
53-
assert predictor is expected_predictor
54-
mock_loader[0].return_value.model.load_checkpoint.assert_called_once_with(
55-
os.path.join(local_path, "model.safetensors")
56-
)
50+
# `from_pretrained` handles both local directories and HF repos.
51+
assert predictor is mock_loader[0].from_pretrained.return_value
52+
mock_loader[0].from_pretrained.assert_called_once_with(local_path)
5753

5854

5955
@pytest.mark.parametrize("model_class, mock_paths", MODEL_PARAMS)

0 commit comments

Comments
 (0)