From ed2f5f3aad8b2e7880b939d2b1e379d6b79dc24d Mon Sep 17 00:00:00 2001 From: cl4wb0rg Date: Mon, 9 Mar 2026 20:08:25 +0000 Subject: [PATCH] fix: make mypy checks pass --- scripts/01_download_wiki.py | 2 +- scripts/smoke_test.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/01_download_wiki.py b/scripts/01_download_wiki.py index 94b753e..d3e6a5d 100644 --- a/scripts/01_download_wiki.py +++ b/scripts/01_download_wiki.py @@ -52,7 +52,7 @@ def _fetch_expected_md5(lang: str, filename: str) -> str | None: for line in resp.read().decode().splitlines(): parts = line.split() if len(parts) == 2 and parts[1] == filename: - return parts[0] + return str(parts[0]) except Exception as exc: log.warning("Could not fetch checksums from %s: %s", url, exc) return None diff --git a/scripts/smoke_test.py b/scripts/smoke_test.py index 42cf9bb..2982e79 100644 --- a/scripts/smoke_test.py +++ b/scripts/smoke_test.py @@ -14,6 +14,7 @@ """ import sys +from typing import NoReturn import torch from peft import LoraConfig, TaskType, get_peft_model @@ -25,11 +26,11 @@ STEPS = 5 -def check(label): +def check(label: str) -> None: print(f" [OK] {label}") -def fail(label, exc): +def fail(label: str, exc: Exception) -> NoReturn: print(f" [FAIL] {label}: {exc}", file=sys.stderr) sys.exit(1)