Repository: huggingface/accelerate (branch: AjayP13-patch-1)
Commit date: 2024-01-19T21:27:45Z

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-19
  UV_INDEX_URL: http://localhost:8629/2024-01-19


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/__init__.py:1:1: I001 [*] Import block is un-sorted or un-formatted
src/accelerate/utils/modeling.py:15:1: I001 [*] Import block is un-sorted or un-formatted
Found 2 errors.
[*] 2 fixable with the `--fix` option.
make: *** [Makefile:16: quality] Error 1
##[error]Process completed with exit code 2.


Changed files:
src/accelerate/utils/__init__.py
src/accelerate/utils/modeling.py

Fix diff:
diff --git a/src/accelerate/utils/__init__.py b/src/accelerate/utils/__init__.py
index ddf794a..7179afb 100644
--- a/src/accelerate/utils/__init__.py
+++ b/src/accelerate/utils/__init__.py
@@ -59,7 +59,6 @@ from .imports import (
     is_comet_ml_available,
     is_cuda_available,
     is_datasets_available,
-    is_peft_available,
     is_deepspeed_available,
     is_dvclive_available,
     is_fp8_available,
@@ -70,6 +69,7 @@ from .imports import (
     is_msamp_available,
     is_npu_available,
     is_pandas_available,
+    is_peft_available,
     is_rich_available,
     is_sagemaker_available,
     is_tensorboard_available,
@@ -81,7 +81,6 @@ from .imports import (
     is_xpu_available,
 )
 from .modeling import (
-    is_peft_model,
     calculate_maximum_sizes,
     check_device_map,
     check_tied_parameters_in_config,
@@ -96,6 +95,7 @@ from .modeling import (
     get_mixed_precision_context_manager,
     id_tensor_storage,
     infer_auto_device_map,
+    is_peft_model,
     load_checkpoint_in_model,
     load_offloaded_weights,
     load_state_dict,
diff --git a/src/accelerate/utils/modeling.py b/src/accelerate/utils/modeling.py
index 802b13c..03d3a39 100644
--- a/src/accelerate/utils/modeling.py
+++ b/src/accelerate/utils/modeling.py
@@ -30,7 +30,7 @@ import torch.nn as nn
 from ..state import AcceleratorState
 from .constants import SAFE_WEIGHTS_NAME, WEIGHTS_NAME
 from .dataclasses import AutocastKwargs, CustomDtype, DistributedType
-from .imports import is_mps_available, is_npu_available, is_xpu_available, is_peft_available
+from .imports import is_mps_available, is_npu_available, is_peft_available, is_xpu_available
 from .offload import load_offloaded_weight, offload_weight, save_offload_index
 from .tqdm import is_tqdm_available, tqdm