update
Browse files- run_whisper_finetuning.py +1 -1
- run_xla.sh +4 -4
- run_xla_test.sh +47 -0
run_whisper_finetuning.py
CHANGED
|
@@ -92,7 +92,7 @@ class Seq2SeqTrainingArguments(TrainingArguments):
|
|
| 92 |
)
|
| 93 |
},
|
| 94 |
)
|
| 95 |
-
|
| 96 |
|
| 97 |
@dataclass
|
| 98 |
class ModelArguments:
|
|
|
|
| 92 |
)
|
| 93 |
},
|
| 94 |
)
|
| 95 |
+
xla: bool = field(default=False, metadata={"help": "Whether to activate the XLA compilation or not"})
|
| 96 |
|
| 97 |
@dataclass
|
| 98 |
class ModelArguments:
|
run_xla.sh
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
# Whisper Finetuning script for the NST dataset
|
| 2 |
# This is a test script for XLA on TPU
|
| 3 |
|
| 4 |
-
python xla_spawn.py --num_cores=4
|
| 5 |
--model_name_or_path="openai/whisper-small" \
|
| 6 |
--output_dir="../whisper-NST-TPU" \
|
| 7 |
--overwrite_output_dir=True \
|
|
@@ -14,7 +14,7 @@ python xla_spawn.py --num_cores=4 run_whisper_finetuining.py
|
|
| 14 |
--audio_column_name="audio" \
|
| 15 |
--text_column_name="text" \
|
| 16 |
--per_device_train_batch_size=16 \
|
| 17 |
-
|
| 18 |
--learning_rate=2e-5 \
|
| 19 |
--warmup_steps=500 \
|
| 20 |
--max_steps=5000 \
|
|
@@ -26,7 +26,6 @@ python xla_spawn.py --num_cores=4 run_whisper_finetuining.py
|
|
| 26 |
--eval_steps=1000 \
|
| 27 |
--max_eval_samples=100 \
|
| 28 |
--logging_steps=250 \
|
| 29 |
-
--fp16=True \
|
| 30 |
--load_best_model_at_end=True \
|
| 31 |
--metric_for_best_model="wer" \
|
| 32 |
--greater_is_better=False \
|
|
@@ -34,6 +33,7 @@ python xla_spawn.py --num_cores=4 run_whisper_finetuining.py
|
|
| 34 |
--predict_with_generate=True \
|
| 35 |
--generation_max_length=225 \
|
| 36 |
--print_training_arguments=True \
|
|
|
|
| 37 |
--push_to_hub=True
|
| 38 |
|
| 39 |
|
|
@@ -44,4 +44,4 @@ python xla_spawn.py --num_cores=4 run_whisper_finetuining.py
|
|
| 44 |
# The zone of the TPU the process is running on. If not specified, we will attempt to automatically detect
|
| 45 |
# from metadata.
|
| 46 |
# xla (:obj:`bool`, `optional`):
|
| 47 |
-
# Whether to activate the XLA compilation or not.
|
|
|
|
| 1 |
# Whisper Finetuning script for the NST dataset
|
| 2 |
# This is a test script for XLA on TPU
|
| 3 |
|
| 4 |
+
python xla_spawn.py --num_cores=4 run_whisper_finetuning.py\
|
| 5 |
--model_name_or_path="openai/whisper-small" \
|
| 6 |
--output_dir="../whisper-NST-TPU" \
|
| 7 |
--overwrite_output_dir=True \
|
|
|
|
| 14 |
--audio_column_name="audio" \
|
| 15 |
--text_column_name="text" \
|
| 16 |
--per_device_train_batch_size=16 \
|
| 17 |
+
--per_device_train_batch_size=16 \
|
| 18 |
--learning_rate=2e-5 \
|
| 19 |
--warmup_steps=500 \
|
| 20 |
--max_steps=5000 \
|
|
|
|
| 26 |
--eval_steps=1000 \
|
| 27 |
--max_eval_samples=100 \
|
| 28 |
--logging_steps=250 \
|
|
|
|
| 29 |
--load_best_model_at_end=True \
|
| 30 |
--metric_for_best_model="wer" \
|
| 31 |
--greater_is_better=False \
|
|
|
|
| 33 |
--predict_with_generate=True \
|
| 34 |
--generation_max_length=225 \
|
| 35 |
--print_training_arguments=True \
|
| 36 |
+
--xla=True \
|
| 37 |
--push_to_hub=True
|
| 38 |
|
| 39 |
|
|
|
|
| 44 |
# The zone of the TPU the process is running on. If not specified, we will attempt to automatically detect
|
| 45 |
# from metadata.
|
| 46 |
# xla (:obj:`bool`, `optional`):
|
| 47 |
+
# Whether to activate the XLA compilation or not.
|
run_xla_test.sh
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Whisper Finetuning script for the NST dataset
|
| 2 |
+
# This is a test script for XLA on TPU
|
| 3 |
+
|
| 4 |
+
PT_XLA_DEBUG=1 python xla_spawn.py --num_cores=4 run_whisper_finetuning.py\
|
| 5 |
+
--model_name_or_path="openai/whisper-small" \
|
| 6 |
+
--output_dir="../whisper-NST-TPU-test" \
|
| 7 |
+
--overwrite_output_dir=True \
|
| 8 |
+
--language="Norwegian" \
|
| 9 |
+
--task="transcribe" \
|
| 10 |
+
--dataset_name="NbAiLab/NST" \
|
| 11 |
+
--dataset_config="no-close" \
|
| 12 |
+
--do_train=True \
|
| 13 |
+
--do_eval=True \
|
| 14 |
+
--audio_column_name="audio" \
|
| 15 |
+
--text_column_name="text" \
|
| 16 |
+
--per_device_train_batch_size=16 \
|
| 17 |
+
--per_device_train_batch_size=16 \
|
| 18 |
+
--learning_rate=2e-5 \
|
| 19 |
+
--warmup_steps=0 \
|
| 20 |
+
--max_steps=10 \
|
| 21 |
+
--gradient_checkpointing=True \
|
| 22 |
+
--gradient_accumulation_steps=1 \
|
| 23 |
+
--group_by_length=False \
|
| 24 |
+
--evaluation_strategy="steps" \
|
| 25 |
+
--save_steps=10 \
|
| 26 |
+
--eval_steps=10 \
|
| 27 |
+
--max_eval_samples=2 \
|
| 28 |
+
--logging_steps=10 \
|
| 29 |
+
--load_best_model_at_end=True \
|
| 30 |
+
--metric_for_best_model="wer" \
|
| 31 |
+
--greater_is_better=False \
|
| 32 |
+
--report_to="tensorboard" \
|
| 33 |
+
--predict_with_generate=True \
|
| 34 |
+
--generation_max_length=225 \
|
| 35 |
+
--print_training_arguments=True \
|
| 36 |
+
--xla=True \
|
| 37 |
+
--push_to_hub=True
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
# Very likely that some of this parameters needs to be added
|
| 41 |
+
# tpu_name (:obj:`str`, `optional`):
|
| 42 |
+
# The name of the TPU the process is running on.
|
| 43 |
+
# tpu_zone (:obj:`str`, `optional`):
|
| 44 |
+
# The zone of the TPU the process is running on. If not specified, we will attempt to automatically detect
|
| 45 |
+
# from metadata.
|
| 46 |
+
# xla (:obj:`bool`, `optional`):
|
| 47 |
+
# Whether to activate the XLA compilation or not.
|