From ec756f90984032d39089a7e420d8345afe11dcdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Budy=C5=9B?= Date: Tue, 9 Jul 2024 16:28:43 +0200 Subject: [PATCH] fix ruff workflow (#105) * fix ruff workflow * add formatting error * add lint error * revert errors --- .github/workflows/ruff.yml | 6 ++++-- mokuro/manga_page_ocr.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ruff.yml b/.github/workflows/ruff.yml index c8a0958..64c1c7a 100644 --- a/.github/workflows/ruff.yml +++ b/.github/workflows/ruff.yml @@ -4,5 +4,7 @@ jobs: ruff: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: chartboost/ruff-action@v1 \ No newline at end of file + - uses: actions/checkout@v4 + - run: pip install --user ruff + - run: ruff check --output-format=github . + - run: ruff format --diff . diff --git a/mokuro/manga_page_ocr.py b/mokuro/manga_page_ocr.py index abb9ae2..2157bb4 100644 --- a/mokuro/manga_page_ocr.py +++ b/mokuro/manga_page_ocr.py @@ -37,7 +37,7 @@ def __init__( if not self.disable_ocr: cuda = torch.cuda.is_available() - device = 'cuda' if cuda and not force_cpu else 'cpu' + device = "cuda" if cuda and not force_cpu else "cpu" logger.info(f"Initializing text detector, using device {device}") self.text_detector = TextDetector( model_path=cache.comic_text_detector, input_size=detector_input_size, device=device, act="leaky"