Repository: huggingface/accelerate (branch: main)
Commit date: 2024-01-05T15:35: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-05
  UV_INDEX_URL: http://localhost:8629/2024-01-05


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
doc-builder style src/accelerate docs/source --max_len 119 --check_only
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.8.18/x64/bin/doc-builder", line 8, in <module>
    sys.exit(main())
  File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/doc_builder/commands/doc_builder_cli.py", line 47, in main
    args.func(args)
  File "/opt/hostedtoolcache/Python/3.8.18/x64/lib/python3.8/site-packages/doc_builder/commands/style.py", line 28, in style_command
    raise ValueError(f"{len(changed)} files should be restyled!")
ValueError: 1 files should be restyled!
make: *** [Makefile:17: quality] Error 1
##[error]Process completed with exit code 2.


Changed files:
src/accelerate/big_modeling.py

Fix diff:
diff --git a/src/accelerate/big_modeling.py b/src/accelerate/big_modeling.py
index 5fd2bd5..6a2392a 100644
--- a/src/accelerate/big_modeling.py
+++ b/src/accelerate/big_modeling.py
@@ -73,7 +73,9 @@ def init_empty_weights(include_buffers: bool = None):
 
     Any model created under this context manager has no weights. As such you can't do something like
     `model.to(some_device)` with it. To load weights inside your empty model, see [`load_checkpoint_and_dispatch`].
-    Make sure to overwrite the default device_map param, otherwise dispatch is not called.
+    Make sure to overwrite the default device_map param for [`load_checkpoint_and_dispatch`], otherwise dispatch is not
+    called.
+
     </Tip>
     """
     if include_buffers is None:
@@ -480,7 +482,7 @@ def load_checkpoint_and_dispatch(
 
             To have Accelerate compute the most optimized `device_map` automatically, set `device_map="auto"`. For more
             information about each option see [here](../concept_guides/big_model_inference#designing-a-device-map).
-            Defaults to None, which means `dispatch_model` will not be called.
+            Defaults to None, which means [`dispatch_model`] will not be called.
         max_memory (`Dict`, *optional*):
             A dictionary device identifier to maximum memory. Will default to the maximum memory available for each GPU
             and the available CPU RAM if unset.