From 8ea412a86faa8e9edeeb6b5c46b08def06aa03ea Mon Sep 17 00:00:00 2001 From: Stas Bekman Date: Fri, 5 Feb 2021 15:51:18 -0800 Subject: [PATCH] [examples] make run scripts executable (#10037) * make executable * make executable * same for the template * cleanup --- examples/benchmarking/run_benchmark.py | 1 + examples/benchmarking/run_benchmark_tf.py | 1 + examples/language-modeling/run_clm.py | 1 + examples/language-modeling/run_mlm.py | 1 + examples/language-modeling/run_mlm_flax.py | 1 + examples/language-modeling/run_plm.py | 1 + examples/legacy/run_camembert.py | 1 + examples/legacy/run_chinese_ref.py | 1 + examples/legacy/run_language_modeling.py | 1 + examples/legacy/run_openai_gpt.py | 1 + examples/legacy/run_swag.py | 1 + examples/legacy/run_transfo_xl.py | 1 + examples/multiple-choice/run_swag.py | 1 + examples/multiple-choice/run_tf_multiple_choice.py | 1 + examples/question-answering/run_qa.py | 1 + examples/question-answering/run_qa_beam_search.py | 1 + examples/question-answering/run_tf_squad.py | 1 + examples/seq2seq/run_seq2seq.py | 1 + examples/text-classification/run_glue.py | 1 + examples/text-classification/run_tf_glue.py | 1 + examples/text-classification/run_tf_text_classification.py | 1 + examples/text-classification/run_xnli.py | 1 + examples/text-generation/run_generation.py | 2 +- examples/token-classification/run_ner.py | 1 + examples/token-classification/run_tf_ner.py | 1 + .../run_{{cookiecutter.example_shortcut}}.py | 1 + 26 files changed, 26 insertions(+), 1 deletion(-) mode change 100644 => 100755 examples/benchmarking/run_benchmark.py mode change 100644 => 100755 examples/benchmarking/run_benchmark_tf.py mode change 100644 => 100755 examples/language-modeling/run_clm.py mode change 100644 => 100755 examples/language-modeling/run_mlm.py mode change 100644 => 100755 examples/language-modeling/run_mlm_flax.py mode change 100644 => 100755 examples/language-modeling/run_plm.py mode change 100644 => 100755 examples/legacy/run_camembert.py mode change 100644 => 100755 examples/legacy/run_chinese_ref.py mode change 100644 => 100755 examples/legacy/run_language_modeling.py mode change 100644 => 100755 examples/legacy/run_openai_gpt.py mode change 100644 => 100755 examples/legacy/run_swag.py mode change 100644 => 100755 examples/legacy/run_transfo_xl.py mode change 100644 => 100755 examples/multiple-choice/run_swag.py mode change 100644 => 100755 examples/multiple-choice/run_tf_multiple_choice.py mode change 100644 => 100755 examples/question-answering/run_qa.py mode change 100644 => 100755 examples/question-answering/run_qa_beam_search.py mode change 100644 => 100755 examples/question-answering/run_tf_squad.py mode change 100644 => 100755 examples/seq2seq/run_seq2seq.py mode change 100644 => 100755 examples/text-classification/run_glue.py mode change 100644 => 100755 examples/text-classification/run_tf_glue.py mode change 100644 => 100755 examples/text-classification/run_tf_text_classification.py mode change 100644 => 100755 examples/text-classification/run_xnli.py mode change 100644 => 100755 examples/text-generation/run_generation.py mode change 100644 => 100755 examples/token-classification/run_ner.py mode change 100644 => 100755 examples/token-classification/run_tf_ner.py mode change 100644 => 100755 templates/adding_a_new_example_script/{{cookiecutter.directory_name}}/run_{{cookiecutter.example_shortcut}}.py diff --git a/examples/benchmarking/run_benchmark.py b/examples/benchmarking/run_benchmark.py old mode 100644 new mode 100755 index f8ab1b308..e2e7d4c5e --- a/examples/benchmarking/run_benchmark.py +++ b/examples/benchmarking/run_benchmark.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # coding=utf-8 # Copyright 2020 The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. diff --git a/examples/benchmarking/run_benchmark_tf.py b/examples/benchmarking/run_benchmark_tf.py old mode 100644 new mode 100755 index aa8486504..25aabc5f5 --- a/examples/benchmarking/run_benchmark_tf.py +++ b/examples/benchmarking/run_benchmark_tf.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. diff --git a/examples/language-modeling/run_clm.py b/examples/language-modeling/run_clm.py old mode 100644 new mode 100755 index 0c655f08b..c5a5bdd0c --- a/examples/language-modeling/run_clm.py +++ b/examples/language-modeling/run_clm.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # coding=utf-8 # Copyright 2020 The HuggingFace Inc. team. All rights reserved. # diff --git a/examples/language-modeling/run_mlm.py b/examples/language-modeling/run_mlm.py old mode 100644 new mode 100755 index dd4c57c59..626a70203 --- a/examples/language-modeling/run_mlm.py +++ b/examples/language-modeling/run_mlm.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # coding=utf-8 # Copyright 2020 The HuggingFace Team All rights reserved. # diff --git a/examples/language-modeling/run_mlm_flax.py b/examples/language-modeling/run_mlm_flax.py old mode 100644 new mode 100755 index 83bf9bffe..c2883118f --- a/examples/language-modeling/run_mlm_flax.py +++ b/examples/language-modeling/run_mlm_flax.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # coding=utf-8 # Copyright 2020 The HuggingFace Team All rights reserved. # diff --git a/examples/language-modeling/run_plm.py b/examples/language-modeling/run_plm.py old mode 100644 new mode 100755 index 74023817a..ebbea9f45 --- a/examples/language-modeling/run_plm.py +++ b/examples/language-modeling/run_plm.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # coding=utf-8 # Copyright 2020 The HuggingFace Team All rights reserved. # diff --git a/examples/legacy/run_camembert.py b/examples/legacy/run_camembert.py old mode 100644 new mode 100755 index 05e36c251..9651570b3 --- a/examples/legacy/run_camembert.py +++ b/examples/legacy/run_camembert.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python import torch from transformers import CamembertForMaskedLM, CamembertTokenizer diff --git a/examples/legacy/run_chinese_ref.py b/examples/legacy/run_chinese_ref.py old mode 100644 new mode 100755 index c5c3c8c87..f7c09e37f --- a/examples/legacy/run_chinese_ref.py +++ b/examples/legacy/run_chinese_ref.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python import argparse import json from typing import List diff --git a/examples/legacy/run_language_modeling.py b/examples/legacy/run_language_modeling.py old mode 100644 new mode 100755 index 4b9f272a0..20995f1bf --- a/examples/legacy/run_language_modeling.py +++ b/examples/legacy/run_language_modeling.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. diff --git a/examples/legacy/run_openai_gpt.py b/examples/legacy/run_openai_gpt.py old mode 100644 new mode 100755 index 7febad29b..72314b5ed --- a/examples/legacy/run_openai_gpt.py +++ b/examples/legacy/run_openai_gpt.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. diff --git a/examples/legacy/run_swag.py b/examples/legacy/run_swag.py old mode 100644 new mode 100755 index c699ffa60..ddce4d20e --- a/examples/legacy/run_swag.py +++ b/examples/legacy/run_swag.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. diff --git a/examples/legacy/run_transfo_xl.py b/examples/legacy/run_transfo_xl.py old mode 100644 new mode 100755 index db3375a20..71f3efa2a --- a/examples/legacy/run_transfo_xl.py +++ b/examples/legacy/run_transfo_xl.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. diff --git a/examples/multiple-choice/run_swag.py b/examples/multiple-choice/run_swag.py old mode 100644 new mode 100755 index 60b25ae6a..28b2605f0 --- a/examples/multiple-choice/run_swag.py +++ b/examples/multiple-choice/run_swag.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # coding=utf-8 # Copyright The HuggingFace Team and The HuggingFace Inc. team. All rights reserved. # diff --git a/examples/multiple-choice/run_tf_multiple_choice.py b/examples/multiple-choice/run_tf_multiple_choice.py old mode 100644 new mode 100755 index 85d9f2127..5ff4e384d --- a/examples/multiple-choice/run_tf_multiple_choice.py +++ b/examples/multiple-choice/run_tf_multiple_choice.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. diff --git a/examples/question-answering/run_qa.py b/examples/question-answering/run_qa.py old mode 100644 new mode 100755 index 11e49d5ec..2163f7fb7 --- a/examples/question-answering/run_qa.py +++ b/examples/question-answering/run_qa.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # coding=utf-8 # Copyright 2020 The HuggingFace Team All rights reserved. # diff --git a/examples/question-answering/run_qa_beam_search.py b/examples/question-answering/run_qa_beam_search.py old mode 100644 new mode 100755 index 5c61a0fe0..d81bff914 --- a/examples/question-answering/run_qa_beam_search.py +++ b/examples/question-answering/run_qa_beam_search.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # coding=utf-8 # Copyright 2020 The HuggingFace Team All rights reserved. # diff --git a/examples/question-answering/run_tf_squad.py b/examples/question-answering/run_tf_squad.py old mode 100644 new mode 100755 index 1632d2d1d..eb2f4089a --- a/examples/question-answering/run_tf_squad.py +++ b/examples/question-answering/run_tf_squad.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. diff --git a/examples/seq2seq/run_seq2seq.py b/examples/seq2seq/run_seq2seq.py old mode 100644 new mode 100755 index 7b423f6d0..3b4ae5ef0 --- a/examples/seq2seq/run_seq2seq.py +++ b/examples/seq2seq/run_seq2seq.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # coding=utf-8 # Copyright The HuggingFace Team and The HuggingFace Inc. team. All rights reserved. # diff --git a/examples/text-classification/run_glue.py b/examples/text-classification/run_glue.py old mode 100644 new mode 100755 index 19a700bf2..9fb1fd774 --- a/examples/text-classification/run_glue.py +++ b/examples/text-classification/run_glue.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # coding=utf-8 # Copyright 2020 The HuggingFace Inc. team. All rights reserved. # diff --git a/examples/text-classification/run_tf_glue.py b/examples/text-classification/run_tf_glue.py old mode 100644 new mode 100755 index be49399b3..1e162a9f5 --- a/examples/text-classification/run_tf_glue.py +++ b/examples/text-classification/run_tf_glue.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # coding=utf-8 # Copyright 2020 The HuggingFace Team. All rights reserved. # diff --git a/examples/text-classification/run_tf_text_classification.py b/examples/text-classification/run_tf_text_classification.py old mode 100644 new mode 100755 index b58e0bf28..729e05229 --- a/examples/text-classification/run_tf_text_classification.py +++ b/examples/text-classification/run_tf_text_classification.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # coding=utf-8 # Copyright 2020 The HuggingFace Team. All rights reserved. # diff --git a/examples/text-classification/run_xnli.py b/examples/text-classification/run_xnli.py old mode 100644 new mode 100755 index 19d3d040e..e0375e53c --- a/examples/text-classification/run_xnli.py +++ b/examples/text-classification/run_xnli.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. diff --git a/examples/text-generation/run_generation.py b/examples/text-generation/run_generation.py old mode 100644 new mode 100755 index ce4348325..56b1de051 --- a/examples/text-generation/run_generation.py +++ b/examples/text-generation/run_generation.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/usr/bin/env python # coding=utf-8 # Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. diff --git a/examples/token-classification/run_ner.py b/examples/token-classification/run_ner.py old mode 100644 new mode 100755 index bdfa3710b..2a8e757c3 --- a/examples/token-classification/run_ner.py +++ b/examples/token-classification/run_ner.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # coding=utf-8 # Copyright 2020 The HuggingFace Team All rights reserved. # diff --git a/examples/token-classification/run_tf_ner.py b/examples/token-classification/run_tf_ner.py old mode 100644 new mode 100755 index 7b5e0d192..93fe93617 --- a/examples/token-classification/run_tf_ner.py +++ b/examples/token-classification/run_tf_ner.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # coding=utf-8 # Copyright 2018 The HuggingFace Inc. team. # diff --git a/templates/adding_a_new_example_script/{{cookiecutter.directory_name}}/run_{{cookiecutter.example_shortcut}}.py b/templates/adding_a_new_example_script/{{cookiecutter.directory_name}}/run_{{cookiecutter.example_shortcut}}.py old mode 100644 new mode 100755 index 8e2c834b2..e6dc9ecc8 --- a/templates/adding_a_new_example_script/{{cookiecutter.directory_name}}/run_{{cookiecutter.example_shortcut}}.py +++ b/templates/adding_a_new_example_script/{{cookiecutter.directory_name}}/run_{{cookiecutter.example_shortcut}}.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python # coding=utf-8 # Copyright {{cookiecutter.authors}} and The HuggingFace Inc. team. All rights reserved. #