Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.
Python ai4sciencedocument-analysisdocxextract-datalayout-analysisocrparserpdfpdf-converterpdf-extractor-llmpdf-extractor-pretrainpdf-extractor-ragpdf-parserpptxpythonxlsx
fix(magic_pdf): correct batch ratio conditions for GPU memory
myhlolib6710b998867
diff --git a/magic_pdf/model/doc_analyze_by_custom_model.py b/magic_pdf/model/doc_analyze_by_custom_model.pyindex 0f9592b9..f1863b5c 100644--- a/magic_pdf/model/doc_analyze_by_custom_model.py+++ b/magic_pdf/model/doc_analyze_by_custom_model.py@@ -178,9 +178,9 @@ def doc_analyze(gpu_memory = int(os.getenv("VIRTUAL_VRAM_SIZE", round(get_vram(device))))if gpu_memory is not None and gpu_memory >= 8:- if 8 <= gpu_memory <= 10:+ if 8 <= gpu_memory < 10:batch_ratio = 2- elif 10 < gpu_memory <= 12:+ elif 10 <= gpu_memory <= 12:batch_ratio = 4elif 12 < gpu_memory <= 16:batch_ratio = 8