add HF equivalency tests for standalone nbs (#774)

* add HF equivalency tests for standalone nbs

* update

* update

* update

* update
This commit is contained in:
Sebastian Raschka
2025-08-18 18:58:46 -05:00
committed by GitHub
parent a6b883c9f9
commit 80d4732456
15 changed files with 389 additions and 91 deletions

View File

@@ -51,8 +51,10 @@ jobs:
pytest --ruff ch04/01_main-chapter-code/tests.py
pytest --ruff ch04/03_kv-cache/tests.py
pytest --ruff ch05/01_main-chapter-code/tests.py
pytest --ruff ch05/07_gpt_to_llama/tests/tests.py
pytest --ruff ch05/12_gemma3/tests/test_gemma3.py
pytest --ruff ch05/07_gpt_to_llama/tests/tests_rope_and_parts.py
pytest --ruff ch05/07_gpt_to_llama/tests/test_llama32_nb.py
pytest --ruff ch05/11_qwen3/tests/test_qwen3_nb.py
pytest --ruff ch05/12_gemma3/tests/test_gemma3_nb.py
pytest --ruff ch06/01_main-chapter-code/tests.py
- name: Validate Selected Jupyter Notebooks (uv)

View File

@@ -50,8 +50,10 @@ jobs:
pytest --ruff setup/02_installing-python-libraries/tests.py
pytest --ruff ch04/01_main-chapter-code/tests.py
pytest --ruff ch05/01_main-chapter-code/tests.py
pytest --ruff ch05/07_gpt_to_llama/tests/tests.py
pytest --ruff ch05/12_gemma3/tests/test_gemma3.py
pytest --ruff ch05/07_gpt_to_llama/tests/tests_rope_and_parts.py
pytest --ruff ch05/07_gpt_to_llama/tests/test_llama32_nb.py
pytest --ruff ch05/11_qwen3/tests/test_qwen3_nb.py
pytest --ruff ch05/12_gemma3/tests/test_gemma3_nb.py
pytest --ruff ch06/01_main-chapter-code/tests.py
- name: Validate Selected Jupyter Notebooks (uv)

View File

@@ -47,7 +47,6 @@ jobs:
pytest --ruff setup/02_installing-python-libraries/tests.py
pytest --ruff ch04/01_main-chapter-code/tests.py
pytest --ruff ch05/01_main-chapter-code/tests.py
pytest --ruff ch05/07_gpt_to_llama/tests/tests.py
pytest --ruff ch06/01_main-chapter-code/tests.py
- name: Validate Selected Jupyter Notebooks

View File

@@ -41,7 +41,6 @@ jobs:
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
pip install -r ch05/07_gpt_to_llama/tests/test-requirements-extra.txt
pip install pytest pytest-ruff nbval
- name: Test Selected Python Scripts
@@ -50,7 +49,6 @@ jobs:
pytest --ruff setup/02_installing-python-libraries/tests.py
pytest --ruff ch04/01_main-chapter-code/tests.py
pytest --ruff ch05/01_main-chapter-code/tests.py
pytest --ruff ch05/07_gpt_to_llama/tests/tests.py
pytest --ruff ch06/01_main-chapter-code/tests.py
- name: Validate Selected Jupyter Notebooks

View File

@@ -50,7 +50,6 @@ jobs:
pytest --ruff setup/02_installing-python-libraries/tests.py
pytest --ruff ch04/01_main-chapter-code/tests.py
pytest --ruff ch05/01_main-chapter-code/tests.py
pytest --ruff ch05/07_gpt_to_llama/tests/tests.py
pytest --ruff ch06/01_main-chapter-code/tests.py
- name: Validate Selected Jupyter Notebooks

View File

@@ -33,7 +33,6 @@ jobs:
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
uv sync --dev --python=3.10 # tests for backwards compatibility
uv pip install -r ch05/07_gpt_to_llama/tests/test-requirements-extra.txt
uv add pytest-ruff nbval
uv pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu
@@ -43,7 +42,6 @@ jobs:
pytest --ruff setup/02_installing-python-libraries/tests.py
pytest --ruff ch04/01_main-chapter-code/tests.py
pytest --ruff ch05/01_main-chapter-code/tests.py
pytest --ruff ch05/07_gpt_to_llama/tests/tests.py
pytest --ruff ch06/01_main-chapter-code/tests.py
- name: Validate Selected Jupyter Notebooks

View File

@@ -43,6 +43,7 @@ jobs:
pip install tensorflow-io-gcs-filesystem==0.31.0 # Explicit for Windows
pip install -r ch05/07_gpt_to_llama/tests/test-requirements-extra.txt
pip install pytest-ruff nbval
pip install -e .
- name: Run Python Tests
shell: bash
@@ -51,7 +52,9 @@ jobs:
pytest --ruff setup/02_installing-python-libraries/tests.py
pytest --ruff ch04/01_main-chapter-code/tests.py
pytest --ruff ch05/01_main-chapter-code/tests.py
pytest --ruff ch05/07_gpt_to_llama/tests/tests.py
pytest --ruff ch05/07_gpt_to_llama/tests/tests_rope_and_parts.py
pytest --ruff ch05/07_gpt_to_llama/tests/test_llama32_nb.py
pytest --ruff ch05/11_qwen3/tests/test_qwen3_nb.py
pytest --ruff ch06/01_main-chapter-code/tests.py
- name: Run Jupyter Notebook Tests

View File

@@ -51,7 +51,6 @@ jobs:
pytest --ruff setup/02_installing-python-libraries/tests.py
pytest --ruff ch04/01_main-chapter-code/tests.py
pytest --ruff ch05/01_main-chapter-code/tests.py
pytest --ruff ch05/07_gpt_to_llama/tests/tests.py
pytest --ruff ch06/01_main-chapter-code/tests.py
- name: Run Jupyter Notebook Tests