
    g                     n    d dl Z d dlZd dlZ ej                  d       ddlmZ d Zedk(  r e        yy)    Nz%(levelname)s:  %(message)s)format   )usability_checkerc                     t        j                  dt         j                        } | j                  dddgdd       | j                  dd	t        j
                  
       | j                         }t        j                  d      }|j                  dk(  r |j                  t        j                         n}|j                  dk(  r |j                  t        j                         nN|j                  dk(  r |j                  t        j                         n|j                  t        j                         t        j                   |j"                  d|      }|r|j%                  d       y |j%                  d       y )NzMAnalyze an ONNX model to determine how well it will work in mobile scenarios.)descriptionformatter_classz--log_leveldebuginfozLogging level)choicesdefaulthelp
model_pathzPath to ONNX model to check)r   typecheck_usabilitywarningF)skip_optimizeloggerzAs NNAPI or CoreML may provide benefits with this model it is recommended to compare the performance of the model using the NNAPI EP on Android, and the CoreML EP on iOS, against the performance using the CPU EP.zBFor optimal performance the model should be used with the CPU EP. )argparseArgumentParserArgumentDefaultsHelpFormatteradd_argumentpathlibPath
parse_argslogging	getLogger	log_levelsetLevelDEBUGINFOWARNINGERRORr   analyze_modelr   r
   )parserargsr   try_epss       h/var/www/openai/venv/lib/python3.12/site-packages/onnxruntime/tools/check_onnx_model_mobile_usability.pyr   r      s   $$g >>F /@&Wfg
+Hw||\D01F~~ &	6	!%	9	$(&--dooU[abG8	
 	XY    __main__)r   r   r   basicConfigmobile_helpersr   r   __name__ r(   r'   <module>r.      sB         8 9 -Z@ z r(   