Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Cache Hugging Face hub

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a different caching mechanism here than what we want to achieve. This gets us caching across different runs, so that we don't have to download the onnx files again. However, since the onnx models are so small, I am not sure this is necessary. Can we spend some time looking into why the hf_download call is not cached during testing?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, we can address this later.

uses: actions/cache@v4
with:
path: ~/.cache/huggingface/hub
key: ${{ runner.os }}-huggingface-hub-v1
restore-keys: |
${{ runner.os }}-huggingface-hub-

- name: Run fast tests
if: ${{ !inputs.run_slow_tests }}
run: uv run pytest -m "not slow" $HSSM_TEST_ARGS
Expand Down
5 changes: 4 additions & 1 deletion tests/rl/test_rl_likelihood_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@
from hssm.rl.likelihoods.two_armed_bandit import compute_v_subject_wise
from hssm.utils import annotate_function

# Use a local fixture to keep CI deterministic and avoid Hugging Face rate limits.
ANGLE_ONNX = Path(__file__).parent.parent / "fixtures" / "angle.onnx"

# Obtain the angle log-likelihood function from an ONNX model.
angle_logp_jax_func = make_jax_matrix_logp_funcs_from_onnx(
model="angle.onnx",
model=ANGLE_ONNX,
)

hssm.set_floatX("float32")
Expand Down
Loading