/usr/local/lib/python3.6/site-packages/transformers/onnx/__pycache__
Edit: /usr/local/lib/python3.6/site-packages/transformers/onnx/__pycache__/convert.cpython-36.pyc (12845B)
3
Eg3J @ s d dl Z d dlmZ d dlmZ d dlmZ d dlmZm Z m
Z
mZmZ d dl
Zd dlmZmZ ddlmZ dd lmZmZmZmZmZ d
dlmZ e rddlmZ e rdd
lmZ erddl m!Z! ddl"m#Z# ej$e%Z&edZ'edddZ(d%ed& dee)edee
e* e
e* f dddZ+d'ed( dee)edee
e* e
e* f dddZ,d)ed* ed+ ee)edee
e* e
e* f dddZ-d,eed- ed. ee
e* e.ddd d!Z/ed/ e e* ee0e
e* f d"d#d$Z1dS )0 N) signature)chain)Path)
TYPE_CHECKINGIterableListTupleUnion)Versionparse )PreTrainedTokenizerBase)
TensorTypeis_tf_availableis_torch_available+is_torch_onnx_dict_inputs_support_availablelogging )
OnnxConfig)PreTrainedModel)TFPreTrainedModel)FeatureExtractionMixin)PreTrainedTokenizerz1.4.0)minimum_versionc C sX y6ddl }t|j}|tk r4td|j d| dW n tk
rR tdY nX dS )z
Check onnxruntime is installed and if the installed version match is recent enough
Raises:
ImportError: If onnxruntime is not installed or too old version is found
r Nz*We found an older version of onnxruntime (z&) but we require onnxruntime to be >= zp to enable all the conversions options.
Please update onnxruntime by running `pip install --upgrade onnxruntime`zonnxruntime doesn't seem to be currently installed. Please install the onnxruntime by running `pip install onnxruntime` and relaunch the conversion.)onnxruntimer __version__ORT_QUANTIZE_MINIMUM_VERSIONImportError)r r Zort_version r C/usr/local/lib/python3.6/site-packages/transformers/onnx/convert.pycheck_onnxruntime_requirements5 s
r r r r )preprocessormodelconfigopsetoutput tokenizerreturnc C sF t | tr|dk rtd|dk r