diff --git a/.github/workflows/basic-tests-linux.yml b/.github/workflows/basic-tests-linux.yml index 8dfb0d0..8d70be7 100644 --- a/.github/workflows/basic-tests-linux.yml +++ b/.github/workflows/basic-tests-linux.yml @@ -41,7 +41,7 @@ jobs: pytest setup/02_installing-python-libraries/tests.py pytest ch04/01_main-chapter-code/tests.py pytest ch05/01_main-chapter-code/tests.py - pytest ch06/01_main-chapter-code/gpt-class-finetune.py --test_mode + pytest ch06/01_main-chapter-code/tests.py - name: Validate Selected Jupyter Notebooks run: | diff --git a/.github/workflows/basic-tests-macos.yml b/.github/workflows/basic-tests-macos.yml index cc34edf..25f7d6e 100644 --- a/.github/workflows/basic-tests-macos.yml +++ b/.github/workflows/basic-tests-macos.yml @@ -41,7 +41,7 @@ jobs: pytest setup/02_installing-python-libraries/tests.py pytest ch04/01_main-chapter-code/tests.py pytest ch05/01_main-chapter-code/tests.py - pytest ch06/01_main-chapter-code/gpt-class-finetune.py --test_mode + pytest ch06/01_main-chapter-code/tests.py - name: Validate Selected Jupyter Notebooks run: | diff --git a/.github/workflows/basic-tests-windows.yml b/.github/workflows/basic-tests-windows.yml index 7c9b1c1..c1b24b8 100644 --- a/.github/workflows/basic-tests-windows.yml +++ b/.github/workflows/basic-tests-windows.yml @@ -44,7 +44,7 @@ jobs: pytest setup/02_installing-python-libraries/tests.py pytest ch04/01_main-chapter-code/tests.py pytest ch05/01_main-chapter-code/tests.py - pytest ch06/01_main-chapter-code/gpt-class-finetune.py --test_mode + pytest ch06/01_main-chapter-code/tests.py - name: Validate Selected Jupyter Notebooks shell: bash diff --git a/ch06/01_main-chapter-code/tests.py b/ch06/01_main-chapter-code/tests.py new file mode 100644 index 0000000..91d3a6f --- /dev/null +++ b/ch06/01_main-chapter-code/tests.py @@ -0,0 +1,18 @@ +# Copyright (c) Sebastian Raschka under Apache License 2.0 (see LICENSE.txt). +# Source for "Build a Large Language Model From Scratch" +# - https://www.manning.com/books/build-a-large-language-model-from-scratch +# Code: https://github.com/rasbt/LLMs-from-scratch + +# File for internal use (unit tests) + + +import subprocess +import pytest + + +def test_gpt_class_finetune(): + command = ["python", "ch06/01_main-chapter-code/gpt-class-finetune.py", "--test_mode"] + + result = subprocess.run(command, capture_output=True, text=True) + assert result.returncode == 0, f"Script exited with errors: {result.stderr}" +