pre-tokenizer-hashes.yml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. name: Check Pre-Tokenizer Hashes
  2. on:
  3. push:
  4. paths:
  5. - 'convert_hf_to_gguf.py'
  6. - 'convert_hf_to_gguf_update.py'
  7. pull_request:
  8. paths:
  9. - 'convert_hf_to_gguf.py'
  10. - 'convert_hf_to_gguf_update.py'
  11. jobs:
  12. pre-tokenizer-hashes:
  13. runs-on: ubuntu-latest
  14. steps:
  15. - name: Checkout repository
  16. uses: actions/checkout@v4
  17. - name: Set up Python
  18. uses: actions/setup-python@v5
  19. with:
  20. python-version: '3.11'
  21. - name: Install Python dependencies
  22. run: |
  23. python3 -m venv .venv
  24. .venv/bin/pip install -r requirements/requirements-convert_hf_to_gguf_update.txt
  25. - name: Update pre-tokenizer hashes
  26. run: |
  27. cp convert_hf_to_gguf.py /tmp
  28. .venv/bin/python convert_hf_to_gguf_update.py --check-missing
  29. - name: Check if committed pre-tokenizer hashes matches generated version
  30. run: |
  31. if ! diff -q convert_hf_to_gguf.py /tmp/convert_hf_to_gguf.py; then
  32. echo "Model pre-tokenizer hashes (in convert_hf_to_gguf.py) do not match generated hashes (from convert_hf_to_gguf_update.py)."
  33. echo "To fix: run ./convert_hf_to_gguf_update.py and commit the updated convert_hf_to_gguf.py along with your changes"
  34. echo "Differences found:"
  35. diff convert_hf_to_gguf.py /tmp/convert_hf_to_gguf.py || true
  36. exit 1
  37. fi
  38. echo "Model pre-tokenizer hashes are up to date."