{"language": "Python", "id": 93, "repo_owner": "mosaicml", "repo_name": "composer", "head_branch": "composer_lora", "workflow_name": "Code Quality Checks", "workflow_filename": "code-quality.yaml", "workflow_path": ".github/workflows/code-quality.yaml", "contributor": "dakinggg", "sha_fail": "06bc6b627d6afb938950382ba50b6b71432d7cf6", "sha_success": "23961743885e704b3f4bd77ba8410b2508d5127c", "workflow": "name: Code Quality Checks\non:\n push:\n branches:\n - dev\n - main\n - release/**\n pull_request:\n workflow_call:\n workflow_dispatch:\n# Cancel old runs when a new commit is pushed to the same branch if not on main or dev\nconcurrency:\n group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}\n cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }}\ndefaults:\n run:\n working-directory: .\njobs:\n code-quality:\n runs-on: ubuntu-20.04\n timeout-minutes: 15\n strategy:\n matrix:\n python_version:\n - \"3.8\"\n - \"3.9\"\n - \"3.10\"\n pip_deps:\n - \"[dev]\"\n steps:\n - uses: actions/checkout@v3\n - uses: actions/setup-python@v4\n with:\n python-version: ${{ matrix.python_version }}\n - name: Setup\n run: |\n set -ex\n python -m pip install --upgrade 'pip<23' wheel\n python -m pip install --upgrade .${{ matrix.pip_deps }}\n - name: Run checks\n run: |\n pre-commit run --all-files\n", "logs": [{"step_name": "code-quality (3.9, [dev])/5_Run checks.txt", "log": "##[group]Run pre-commit run --all-files\n\u001b[36;1mpre-commit run --all-files\u001b[0m\nshell: /usr/bin/bash -e {0}\nenv:\n pythonLocation: /opt/hostedtoolcache/Python/3.9.18/x64\n PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib/pkgconfig\n Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64\n Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64\n Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.9.18/x64\n LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib\n##[endgroup]\n[INFO] Initializing environment for https://github.com/astral-sh/ruff-pre-commit.\n[INFO] Initializing environment for https://github.com/google/yapf.\n[INFO] Initializing environment for https://github.com/google/yapf:toml.\n[INFO] Initializing environment for https://github.com/pycqa/isort.\n[INFO] Initializing environment for https://github.com/PyCQA/pydocstyle.\n[INFO] Initializing environment for https://github.com/PyCQA/pydocstyle:toml.\n[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.\n[INFO] Initializing environment for https://github.com/Lucas-C/pre-commit-hooks.\n[INFO] Initializing environment for https://github.com/kynan/nbstripout.\n[INFO] Initializing environment for local:pyright@1.1.310.\n[INFO] Initializing environment for https://github.com/trufflesecurity/trufflehog.git.\n[INFO] Installing environment for https://github.com/astral-sh/ruff-pre-commit.\n[INFO] Once installed this environment will be reused.\n[INFO] This may take a few minutes...\n[INFO] Installing environment for https://github.com/google/yapf.\n[INFO] Once installed this environment will be reused.\n[INFO] This may take a few minutes...\n[INFO] Installing environment for https://github.com/pycqa/isort.\n[INFO] Once installed this environment will be reused.\n[INFO] This may take a few minutes...\n[INFO] Installing environment for https://github.com/PyCQA/pydocstyle.\n[INFO] Once installed this environment will be reused.\n[INFO] This may take a few minutes...\n[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.\n[INFO] Once installed this environment will be reused.\n[INFO] This may take a few minutes...\n[INFO] Installing environment for https://github.com/Lucas-C/pre-commit-hooks.\n[INFO] Once installed this environment will be reused.\n[INFO] This may take a few minutes...\n[INFO] Installing environment for https://github.com/kynan/nbstripout.\n[INFO] Once installed this environment will be reused.\n[INFO] This may take a few minutes...\n[INFO] Installing environment for local.\n[INFO] Once installed this environment will be reused.\n[INFO] This may take a few minutes...\n[INFO] Installing environment for https://github.com/trufflesecurity/trufflehog.git.\n[INFO] Once installed this environment will be reused.\n[INFO] This may take a few minutes...\nruff.....................................................................Passed\nyapf.....................................................................Passed\nisort....................................................................Failed\n- hook id: isort\n- files were modified by this hook\n\nFixing /home/runner/work/composer/composer/tests/models/test_hf_model.py\nSkipped 1 files\n\npydocstyle...............................................................Passed\ncheck for added large files..............................................Passed\ncheck python ast.........................................................Passed\ncheck builtin type constructor use.......................................Passed\ncheck for case conflicts.................................................Passed\ncheck docstring is first.................................................Passed\ncheck that executables have shebangs.....................................Passed\ncheck json...............................................................Passed\ncheck that scripts with shebangs are executable..........................Passed\npretty format json.......................................................Passed\ncheck for merge conflicts................................................Passed\ncheck for broken symlinks................................................Passed\ncheck toml...............................................................Passed\ncheck vcs permalinks.....................................................Passed\ncheck xml................................................................Passed\ncheck yaml...............................................................Passed\ndebug statements (python)................................................Passed\ndetect destroyed symlinks................................................Passed\nfix double quoted strings................................................Passed\nfix end of files.........................................................Passed\nfix utf-8 byte order marker..............................................Passed\nmixed line ending........................................................Passed\ntrim trailing whitespace.................................................Passed\nInsert license in comments...............................................Passed\nnbstripout...............................................................Passed\npyright..................................................................Passed\nsecret scan..............................................................Passed\n##[error]Process completed with exit code 1.\n"}], "diff": "diff --git a/composer/models/huggingface.py b/composer/models/huggingface.py\nindex f3855ce6..c223a917 100644\n--- a/composer/models/huggingface.py\n+++ b/composer/models/huggingface.py\n@@ -111,6 +111,13 @@ class HuggingFaceModel(ComposerModel):\n conda_package='peft',\n conda_channel='conda-forge')\n \n+ if peft_config is not None:\n+ # Hugging Face requires the peft type and task type to be upper case, so we do that here\n+ # https://github.com/huggingface/peft/blob/ebbff4023ad276cbcb2466fd7e99be7d3ae0ae11/src/peft/utils/peft_types.py#L22-L51\n+ if isinstance(peft_config.peft_type, str):\n+ peft_config.peft_type = peft_config.peft_type.upper()\n+ if isinstance(peft_config.task_type, str):\n+ peft_config.task_type = peft_config.task_type.upper()\n if peft_config is not None and peft_config.peft_type != 'LORA':\n raise ValueError(\n f'PEFT type {peft_config.peft_type} is not supported by HuggingFaceModel. Only LORA is supported.')\ndiff --git a/tests/models/test_hf_model.py b/tests/models/test_hf_model.py\nindex c3c59e1c..a69b56b5 100644\n--- a/tests/models/test_hf_model.py\n+++ b/tests/models/test_hf_model.py\n@@ -28,8 +28,6 @@ from tests.common.markers import device, world_size\n from tests.common.models import (configure_tiny_bert_model, configure_tiny_bert_tokenizer, configure_tiny_gpt2_model,\n configure_tiny_gpt2_tokenizer, configure_tiny_mistral_model,\n configure_tiny_mistral_tokenizer, configure_tiny_t5_model, configure_tiny_t5_tokenizer)\n-from tests.common.models import (configure_tiny_bert_model, configure_tiny_bert_tokenizer, configure_tiny_gpt2_model,\n- configure_tiny_gpt2_tokenizer, configure_tiny_t5_model, configure_tiny_t5_tokenizer)\n from tests.loggers.test_remote_uploader_downloader import DummyObjectStore\n \n if TYPE_CHECKING:\n", "difficulty": 0, "changed_files": ["composer/models/huggingface.py", "tests/models/test_hf_model.py"], "commit_link": "https://github.com/mosaicml/composer/tree/06bc6b627d6afb938950382ba50b6b71432d7cf6"}