Skip to content

Commit

Permalink
Merge pull request #150 from VikParuchuri/dev
Browse files Browse the repository at this point in the history
Fix mps check
  • Loading branch information
VikParuchuri committed May 30, 2024
2 parents aa8e7f0 + 0545bb7 commit 53125ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -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 <github@vikas.sh>"]
readme = "README.md"
Expand Down

0 comments on commit 53125ac

Please sign in to comment.