/usr/local/lib/python3.6/site-packages/transformers/commands/__pycache__
NameSizeModeActions
add_new_model.cpython-36.pyc65310644editdlrm
add_new_model_like.cpython-36.pyc426880644editdlrm
convert.cpython-36.pyc49430644editdlrm
download.cpython-36.pyc16600644editdlrm
env.cpython-36.pyc26050644editdlrm
lfs.cpython-36.pyc72440644editdlrm
run.cpython-36.pyc33720644editdlrm
serving.cpython-36.pyc67480644editdlrm
train.cpython-36.pyc45890644editdlrm
transformers_cli.cpython-36.pyc12610644editdlrm
user.cpython-36.pyc84530644editdlrm
__init__.cpython-36.pyc7940644editdlrm
Edit: /usr/local/lib/python3.6/site-packages/transformers/commands/__pycache__/convert.cpython-36.pyc (4943B)
3 Eg@sNddlmZmZddlmZddlmZedddZd ZGd d d eZ d S) )ArgumentParser Namespace)logging)BaseTransformersCLICommand)argscCst|j|j|j|j|jS)zx Factory function used to convert a model TF 1.0 checkpoint in a PyTorch checkpoint. Returns: ServeCommand )ConvertCommand model_type tf_checkpointpytorch_dump_outputconfigfinetuning_task_name)rrG/usr/local/lib/python3.6/site-packages/transformers/commands/convert.pyconvert_command_factorysrz transformers can only be used from the commandline to convert TensorFlow models in PyTorch, In that case, it requires TensorFlow to be installed. Please see https://www.tensorflow.org/install/ for installation instructions. c@s<eZdZeedddZeeeeedddZddZd S) r )parsercCsx|jddd}|jdtddd|jdtdd d|jd tdd d|jd td dd|jdtddd|jtddS)z Register this command to argparse so it's available for the transformer-cli Args: parser: Root parser to register command-specific arguments convertzcCLI tool to run convert model from original author checkpoints to Transformers PyTorch checkpoints.)helpz --model_typeTz Model's type.)typerequiredrz--tf_checkpointz%TensorFlow checkpoint path or folder.z--pytorch_dump_outputz'Path to the PyTorch saved model output.z--configz"Configuration file path or folder.)rdefaultrz--finetuning_task_nameNzEOptional fine-tuning task name if the TF model was a finetuned model.)func) add_parser add_argumentstr set_defaultsr)rZ train_parserrrrregister_subcommand'sz"ConvertCommand.register_subcommand)r r r r rcGs@tjd|_|jjd|||_||_||_||_||_dS)Nztransformers-cli/convertingzLoading model ) r get_logger_loggerinfo _model_type_tf_checkpoint_pytorch_dump_output_config_finetuning_task_name)selfr r r r rrrrr__init__Ds zConvertCommand.__init__c Cs|jdkrNyddlm}Wntk r6ttYnX||j|j|jn|jdkryddlm}Wntk rttYnX||j|j|jnn|jdkryddl m}Wntk rttYnX||j|j|jn |jdkrmodels.albert.convert_albert_original_tf_checkpoint_to_pytorchr) ImportErrorIMPORT_ERROR_MESSAGEr#r%r$Z:models.bert.convert_bert_original_tf_checkpoint_to_pytorchZ>models.funnel.convert_funnel_original_tf_checkpoint_to_pytorchZ6models.t5.convert_t5_original_tf_checkpoint_to_pytorchZ>models.openai.convert_openai_original_tf_checkpoint_to_pytorchr*ZFmodels.transfo_xl.convert_transfo_xl_original_tf_checkpoint_to_pytorchr+lowerZ:models.gpt2.convert_gpt2_original_tf_checkpoint_to_pytorchr,Zs