tests.py 597 B

12345678910111213141516
  1. # Copyright (c) Sebastian Raschka under Apache License 2.0 (see LICENSE.txt).
  2. # Source for "Build a Large Language Model From Scratch"
  3. # - https://www.manning.com/books/build-a-large-language-model-from-scratch
  4. # Code: https://github.com/rasbt/LLMs-from-scratch
  5. # File for internal use (unit tests)
  6. import subprocess
  7. def test_gpt_class_finetune():
  8. command = ["python", "ch06/01_main-chapter-code/gpt_class_finetune.py", "--test_mode"]
  9. result = subprocess.run(command, capture_output=True, text=True)
  10. assert result.returncode == 0, f"Script exited with errors: {result.stderr}"