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
refactor(table): add device configuration for Unitable model
myhlolie64d4fed4098
diff --git a/magic_pdf/model/sub_modules/table/rapidtable/rapid_table.py b/magic_pdf/model/sub_modules/table/rapidtable/rapid_table.pyindex 0610d1e3..5a30c383 100644--- a/magic_pdf/model/sub_modules/table/rapidtable/rapid_table.py+++ b/magic_pdf/model/sub_modules/table/rapidtable/rapid_table.py@@ -5,6 +5,8 @@ from loguru import loggerfrom rapid_table import RapidTable, RapidTableInputfrom rapid_table.main import ModelType+from magic_pdf.libs.config_reader import get_device+class RapidTableModel(object):def __init__(self, ocr_engine, table_sub_model_name):@@ -13,7 +15,7 @@ class RapidTableModel(object):input_args = RapidTableInput()elif table_sub_model_name in sub_model_list:if torch.cuda.is_available() and table_sub_model_name == "unitable":- input_args = RapidTableInput(model_type=table_sub_model_name, use_cuda=True)+ input_args = RapidTableInput(model_type=table_sub_model_name, use_cuda=True, device=get_device())else:input_args = RapidTableInput(model_type=table_sub_model_name)else: