Refac docstrings in training_utils.py by RogerSinghChugh · Pull Request #9724 · huggingface/diffusers (original) (raw)

It looks like you should run make quality --fix, run make style, and then push those changes.

I think the How to open a PR is the only doc we have about running these commands, but we're always happy to help with any issues beyond that 🤗

Thanks a lot for your help @stevhliu , so as per How to open a PR I tried running make style first and this is the output I got(no errors here but it modified a lot of files):

ruff check examples scripts src tests utils benchmarks setup.py --fix
ruff format examples scripts src tests utils benchmarks setup.py
1124 files left unchanged
doc-builder style src/diffusers docs/source --max_len 119
Overwriting content of src/diffusers\callbacks.py.
Overwriting content of src/diffusers\commands\fp16_safetensors.py.
.
.
Overwriting content of src/diffusers\video_processor.py.
Cleaned 365 files!
C:/ProgramData/chocolatey/lib/make/tools/install/bin/make.exe autogenerate_code
make[1]: Entering directory '<pathToDiffusers>/diffusers'
running deps_table_update
updating src/diffusers/dependency_versions_table.py
make[1]: Leaving directory '<pathToDiffusers>/diffusers'
C:/ProgramData/chocolatey/lib/make/tools/install/bin/make.exe extra_style_checks
make[1]: Entering directory '<pathToDiffusers>/diffusers'
python utils/custom_init_isort.py
python utils/check_doc_toc.py --fix_and_overwrite
make[1]: Leaving directory '<pathToDiffusers>/diffusers'

Then I ran make quality, got a similar response as last time:

ruff check examples scripts src tests utils benchmarks setup.py
src\diffusers\loaders\lora_pipeline.py:345:1: W293 [*] Blank line contains whitespace
src\diffusers\loaders\lora_pipeline.py:606:1: W293 [*] Blank line contains whitespace
src\diffusers\loaders\lora_pipeline.py:871:1: W293 [*] Blank line contains whitespace
src\diffusers\loaders\lora_pipeline.py:1233:1: W293 [*] Blank line contains whitespace
src\diffusers\loaders\lora_pipeline.py:1309:1: W293 [*] Blank line contains whitespace
src\diffusers\loaders\lora_pipeline.py:1433:1: W293 [*] Blank line contains whitespace
src\diffusers\loaders\lora_pipeline.py:1829:1: W293 [*] Blank line contains whitespace
src\diffusers\loaders\lora_pipeline.py:1897:1: W293 [*] Blank line contains whitespace
src\diffusers\loaders\lora_pipeline.py:2026:1: W293 [*] Blank line contains whitespace
src\diffusers\loaders\lora_pipeline.py:2390:1: W293 [*] Blank line contains whitespace
src\diffusers\loaders\lora_pipeline.py:2672:1: W293 [*] Blank line contains whitespace
src\diffusers\loaders\lora_pipeline.py:2723:1: W293 [*] Blank line contains whitespace
Found 12 errors.
[*] 12 fixable with the `--fix` option.
make: *** [Makefile:43: quality] Error 1

As per your suggestion I tried running make quality --fix but that didn't work, here is the output:

C:\ProgramData\chocolatey\lib\make\tools\install\bin\make.exe: unrecognized option '--fix'
Usage: make [options] [target] ...
Options:
  -b, -m                      Ignored for compatibility.
  -B, --always-make           Unconditionally make all targets.
.
.

I then figured out that the --fix option is to be used with ruff check $(check_dirs) setup.py that is part of the quality section of the makefile, tried doing that but then got this:

ruff check examples scripts src tests utils benchmarks setup.py --fix
Found 12 errors (12 fixed, 0 remaining).
ruff format --check examples scripts src tests utils benchmarks setup.py
Would reformat: src\diffusers\callbacks.py
Would reformat: src\diffusers\commands\fp16_safetensors.py
Would reformat: src\diffusers\configuration_utils.py
.
.
Would reformat: src\diffusers\video_processor.py
365 files would be reformatted, 759 files left unchanged
make: *** [Makefile:44: quality] Error 1

So I have met with another error here, where do I go from here? Is there anything else I can provide you with that'll help you in helping me? I also had to install hf-doc-builder to use the make file, if versioning of the package is an issue(like it was for ruff) please let me know, right now I'm running hf-doc-builder 0.5.0.