@@ -90,6 +90,7 @@ def partition_pdf(
9090 infer_table_structure = infer_table_structure ,
9191 ocr_languages = ocr_languages ,
9292 max_partition = max_partition ,
93+ ** kwargs ,
9394 )
9495
9596
@@ -102,6 +103,7 @@ def partition_pdf_or_image(
102103 infer_table_structure : bool = False ,
103104 ocr_languages : str = "eng" ,
104105 max_partition : Optional [int ] = 1500 ,
106+ ** kwargs ,
105107) -> List [Element ]:
106108 """Parses a pdf or image document into a list of interpreted elements."""
107109 # TODO(alan): Extract information about the filetype to be processed from the template
@@ -128,6 +130,7 @@ def partition_pdf_or_image(
128130 infer_table_structure = infer_table_structure ,
129131 include_page_breaks = include_page_breaks ,
130132 ocr_languages = ocr_languages ,
133+ ** kwargs ,
131134 )
132135
133136 elif strategy == "fast" :
@@ -160,6 +163,8 @@ def _partition_pdf_or_image_local(
160163 infer_table_structure : bool = False ,
161164 include_page_breaks : bool = False ,
162165 ocr_languages : str = "eng" ,
166+ model_name : Optional [str ] = None ,
167+ ** kwargs ,
163168) -> List [Element ]:
164169 """Partition using package installed locally."""
165170 try :
@@ -182,7 +187,7 @@ def _partition_pdf_or_image_local(
182187 "running make install-local-inference from the root directory of the repository." ,
183188 ) from e
184189
185- model_name = os .environ .get ("UNSTRUCTURED_HI_RES_MODEL_NAME" )
190+ model_name = model_name if model_name else os .environ .get ("UNSTRUCTURED_HI_RES_MODEL_NAME" )
186191 if file is None :
187192 layout = process_file_with_model (
188193 filename ,
0 commit comments