@@ -202,6 +202,7 @@ def validate_model(
202202 optimization : Optional [str ] = None ,
203203 quiet : bool = False ,
204204 patch : bool = False ,
205+ stop_if_static : bool = True ,
205206 dump_folder : Optional [str ] = None ,
206207 drop_inputs : Optional [List [str ]] = None ,
207208) -> Tuple [Dict [str , Union [int , float , str ]], Dict [str , Any ]]:
@@ -223,7 +224,10 @@ def validate_model(
223224 :param optimization: optimization to apply to the exported model,
224225 depend on the the exporter
225226 :param quiet: if quiet, catches exception if any issue
226- :param patch: applies patches before exporting
227+ :param patch: applies patches (``patch_transformers=True``) before exporting,
228+ see :func:`onnx_diagnostic.torch_export_patches.bypass_export_some_errors`
229+ :param stop_if_static: stops if a dynamic dimension becomes static,
230+ see :func:`onnx_diagnostic.torch_export_patches.bypass_export_some_errors`
227231 :param dump_folder: dumps everything in a subfolder of this one
228232 :param drop_inputs: drops this list of inputs (given their names)
229233 :return: two dictionaries, one with some metrics,
@@ -354,7 +358,9 @@ def validate_model(
354358 if verbose :
355359 print ("[validate_model] applies patches before exporting" )
356360 with bypass_export_some_errors ( # type: ignore
357- patch_transformers = True , verbose = max (0 , verbose - 1 )
361+ patch_transformers = True ,
362+ stop_if_static = stop_if_static ,
363+ verbose = max (0 , verbose - 1 ),
358364 ) as modificator :
359365 data ["inputs_export" ] = modificator (data ["inputs" ]) # type: ignore
360366
0 commit comments