diff --git a/convert.py b/convert.py index 711b505..615ea62 100755 --- a/convert.py +++ b/convert.py @@ -109,11 +109,13 @@ def main(): model_lst = load_all_models() for model in model_lst: + if model is None: + continue + if model.device.type == "mps": raise ValueError("Cannot use MPS with torch multiprocessing share_memory. You have to use CUDA or CPU. Set the TORCH_DEVICE environment variable to change the device.") - if model: - model.share_memory() + model.share_memory() print(f"Converting {len(files_to_convert)} pdfs in chunk {args.chunk_idx + 1}/{args.num_chunks} with {total_processes} processes, and storing in {out_folder}") task_args = [(f, out_folder, metadata.get(os.path.basename(f)), args.min_length) for f in files_to_convert] diff --git a/pyproject.toml b/pyproject.toml index 89a75a7..aa1b5aa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "marker-pdf" -version = "0.2.12" +version = "0.2.13" description = "Convert PDF to markdown with high speed and accuracy." authors = ["Vik Paruchuri "] readme = "README.md"