diff --git a/README.md b/README.md index 959a1dc..6a92632 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,9 @@ $ rapid_latex_ocr tests/test_files/6.png ``` ### Changlog +2023-12-10 v0.0.6 update: +- Fixed issue #12 + 2023-12-07 v0.0.5 update: - Add the relevant code to automatically download the model when installing the package diff --git a/rapid_latex_ocr/main.py b/rapid_latex_ocr/main.py index 86c80d1..7058cb3 100644 --- a/rapid_latex_ocr/main.py +++ b/rapid_latex_ocr/main.py @@ -62,8 +62,9 @@ def get_model_path( self, ) -> Tuple[str]: def try_download(file_name): - if downloader(file_name): - return default_model_dir / file_name + save_path = default_model_dir / file_name + if save_path.exists() or downloader(file_name): + return save_path raise FileNotFoundError(f"{file_name} must not be None.") downloader = DownloadModel()