Skip to content

Commit

Permalink
Merge pull request #190 from danmcp/fixtypos
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
mergify[bot] authored Aug 30, 2024
2 parents 78a110b + 9310180 commit 98fc94c
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 27 deletions.
1 change: 0 additions & 1 deletion .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ pull_request_rules:
- -files~=^scripts/[^/]+\.sh$
- -files=.github/workflows/lint.yml


actions:
merge:
method: merge
Expand Down
64 changes: 41 additions & 23 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ on:
- 'pyproject.toml'
- 'requirements*.txt'
- 'tox.ini'
- 'scripts/*.sh'
- '.github/workflows/lint.yml'
- 'scripts/*.sh' # Used by this workflow
- '.github/workflows/lint.yml' # This workflow
pull_request:
branches:
- "main"
Expand All @@ -23,18 +23,40 @@ on:
- 'pyproject.toml'
- 'requirements*.txt'
- 'tox.ini'
- 'scripts/*.sh'
- '.github/workflows/lint.yml'
- 'scripts/*.sh' # Used by this workflow
- '.github/workflows/lint.yml' # This workflow

env:
PYTHON_VERSION: 3.11
LC_ALL: en_US.UTF-8

defaults:
run:
shell: bash

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest
name: "${{ matrix.lint.name }}"
strategy:
fail-fast: false
matrix:
lint:
- name: "ruff"
commands: |
tox -e ruff -- check
- name: "pylint"
commands: |
echo "::add-matcher::.github/workflows/matchers/pylint.json"
tox -e lint
- name: "mypy"
commands: |
tox -e mypy
steps:
- name: "Harden Runner"
uses: step-security/harden-runner@17d0e2bd7d51742c71671bd19fa12bdc9d40a3d6 # v2.8.1
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs

Expand All @@ -43,34 +65,30 @@ jobs:
with:
# https://github.com/actions/checkout/issues/249
fetch-depth: 0
submodules: true

- name: Setup Python 3.11
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
with:
python-version: 3.11
cache: pip
cache-dependency-path: |
**/pyproject.toml
**/requirements*.txt
- name: Install dependencies
id: deps
- name: Install tox
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Run Ruff check
run: |
tox -e ruff -- check
python -m pip install tox tox-gh
- name: Run linting
if: ${{ !cancelled() && (steps.deps.outcome == 'success') }}
- name: "${{ matrix.lint.name }}"
run: |
echo "::add-matcher::.github/workflows/matchers/pylint.json"
tox -e lint
${{ matrix.lint.commands }}
env:
RUFF_OUTPUT_FORMAT: github

- name: Run mypy type checks
if: ${{ !cancelled() && (steps.deps.outcome == 'success') }}
run: |
tox -e mypy
lint-workflow-complete:
needs: ["lint"]
runs-on: ubuntu-latest
steps:
- name: Lint Workflow Complete
run: echo "Lint Workflow Complete"
6 changes: 3 additions & 3 deletions src/instructlab/training/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def prepare_universal_checkpoint_from_latest(output_dir):
Be aware that this creates an extra dir `zero/` in the checkpoint dir,
which doubles the DS checkpoint storage requirement.
- DS checkpoints store 3X model parameters in 32bit.
- e.g., will be 6X a model paramter-only checkpoint in 16bit.
- e.g., will be 6X a model parameter-only checkpoint in 16bit.
Note that this requires a latest version of deepspeed. It kind of works if
the model is not saving universal checkpoint info, but only in the
Expand Down Expand Up @@ -509,7 +509,7 @@ def ensure_loadable_granite_checkpoint(
# in different nodes
tmpdir = Path(tmpdir) / f"tmp.{group_rank}"
if os.path.exists(tmpdir) and (not dist.is_initialized() or local_rank == 0):
# need to delete if it exists because import doesnt like it to
# need to delete if it exists because import doesn't like it to
shutil.rmtree(tmpdir, ignore_errors=True)

if not dist.is_initialized() or local_rank == 0:
Expand Down Expand Up @@ -670,7 +670,7 @@ def save_hf_format_ds(
save_file(model_state, Path(tmpdir) / WEIGHTS_NAME)
tmp_conf.to_json_file(Path(tmpdir) / CONFIG_NAME)
tokenizer.save_pretrained(tmpdir)
# export doesnt like the directory to exist
# export doesn't like the directory to exist
shutil.rmtree(output_dir)

export_to_huggingface(
Expand Down

0 comments on commit 98fc94c

Please sign in to comment.