Update docs.yml with RUF and FA ruff formatting (#22480)

Signed-off-by: Glenn Jocher <glenn.jocher@ultralytics.com>
Co-authored-by: UltralyticsAssistant <web@ultralytics.com>
This commit is contained in:
Glenn Jocher 2025-10-24 11:58:32 +02:00 committed by GitHub
parent e544db4383
commit 88438a86f7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View file

@ -57,9 +57,9 @@ jobs:
ruff check \
--fix \
--unsafe-fixes \
--extend-select F,I,D,UP \
--extend-select F,I,D,UP,RUF,FA \
--target-version py39 \
--ignore D100,D104,D203,D205,D212,D213,D401,D406,D407,D413 \
--ignore D100,D104,D203,D205,D212,D213,D401,D406,D407,D413,RUF001,RUF002,RUF012 \
.
- name: Update Docs Reference Section and Push Changes
continue-on-error: true
@ -80,9 +80,9 @@ jobs:
- name: Ruff checks
run: |
ruff check \
--extend-select F,I,D,UP \
--extend-select F,I,D,UP,RUF,FA \
--target-version py39 \
--ignore D100,D104,D203,D205,D212,D213,D401,D406,D407,D413 \
--ignore D100,D104,D203,D205,D212,D213,D401,D406,D407,D413,RUF001,RUF002,RUF012 \
.
- name: Build Docs and Check for Warnings
run: |

View file

@ -877,7 +877,7 @@ class Model(torch.nn.Module):
>>> model = model._apply(lambda t: t.cuda()) # Move model to GPU
"""
self._check_is_pytorch_model()
self = super()._apply(fn) # noqa
self = super()._apply(fn)
self.predictor = None # reset predictor as device may have changed
self.overrides["device"] = self.device # was str(self.device) i.e. device(type='cuda', index=0) -> 'cuda:0'
return self