From 75801019981492eedf9280cb352eea3d8e99b65f Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Mon, 2 Aug 2021 21:13:48 +0200 Subject: Fix log import, fix mapping in datamodules, fix nn modules can be hashed --- text_recognizer/data/download_utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'text_recognizer/data/download_utils.py') diff --git a/text_recognizer/data/download_utils.py b/text_recognizer/data/download_utils.py index e3dc68c..8938830 100644 --- a/text_recognizer/data/download_utils.py +++ b/text_recognizer/data/download_utils.py @@ -4,7 +4,7 @@ from pathlib import Path from typing import Dict, List, Optional from urllib.request import urlretrieve -from loguru import logger +from loguru import logger as log from tqdm import tqdm @@ -32,7 +32,7 @@ class TqdmUpTo(tqdm): total_size (Optional[int]): Total size in tqdm units. Defaults to None. """ if total_size is not None: - self.total = total_size # pylint: disable=attribute-defined-outside-init + self.total = total_size self.update(blocks * block_size - self.n) @@ -62,9 +62,9 @@ def download_dataset(metadata: Dict, dl_dir: Path) -> Optional[Path]: filename = dl_dir / metadata["filename"] if filename.exists(): return - logger.info(f"Downloading raw dataset from {metadata['url']} to {filename}...") + log.info(f"Downloading raw dataset from {metadata['url']} to {filename}...") _download_url(metadata["url"], filename) - logger.info("Computing the SHA-256...") + log.info("Computing the SHA-256...") sha256 = _compute_sha256(filename) if sha256 != metadata["sha256"]: raise ValueError( -- cgit v1.2.3-70-g09d2