Repository: huggingface/accelerate (branch: AjayP13-patch-1)
Commit date: 2024-01-10T13:26:31Z

Workflow file: .github/workflows/quality.yml (Quality Check)
name: Quality Check

on: [pull_request]

jobs:
  quality:
    runs-on: ubuntu-latest
    services:
      pypi_wayback:
        image: ghcr.io/waleko/pypi-wayback
        ports:
          - 8629:8080
    steps:
    - uses: actions/checkout@v3.1.0
    - name: Set up Python 3.8
      uses: actions/setup-python@v3
      with:
        python-version: 3.8
    - name: Install Python dependencies
      run: pip install -e .[quality]
    - name: Run Quality check
      run: make quality
    - name: Check if failure
      if: ${{ failure() }}
      run: |
        echo "Quality check failed. Please ensure the right dependency versions are installed with 'pip install -e .[quality]' and rerun 'make style; make quality;'" >> $GITHUB_STEP_SUMMARY


env:
  PIP_INDEX_URL: http://localhost:8629/2024-01-10
  UV_INDEX_URL: http://localhost:8629/2024-01-10


Failed build logs:
step_name: quality/5_Run Quality check.txt
log: ##[group]Run make quality
[36;1mmake quality[0m
shell: /usr/bin/bash -e {0}
env:
  pythonLocation: /opt/hostedtoolcache/Python/3.8.18/x64
  LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.8.18/x64/lib
##[endgroup]
black --required-version 23 --check tests src examples benchmarks utils
All done! ✨ 🍰 ✨
118 files would be left unchanged.
ruff tests src examples benchmarks utils
src/accelerate/utils/fsdp_utils.py:14:1: I001 [*] Import block is un-sorted or un-formatted
Found 1 error.
[*] 1 fixable with the `--fix` option.
make: *** [Makefile:16: quality] Error 1
##[error]Process completed with exit code 2.


Changed files:
src/accelerate/utils/fsdp_utils.py

Fix diff:
diff --git a/src/accelerate/utils/fsdp_utils.py b/src/accelerate/utils/fsdp_utils.py
index 35126fc..a638825 100644
--- a/src/accelerate/utils/fsdp_utils.py
+++ b/src/accelerate/utils/fsdp_utils.py
@@ -17,7 +17,7 @@ import torch
 
 from ..logging import get_logger
 from .constants import FSDP_MODEL_NAME, FSDP_PYTORCH_VERSION, OPTIMIZER_NAME
-from .imports import is_torch_distributed_available, is_peft_available
+from .imports import is_peft_available, is_torch_distributed_available
 from .other import extract_model_from_parallel
 from .versions import is_torch_version