infinitejoy
commited on
Commit
•
2635b09
1
Parent(s):
fafb9bc
training code
Browse files- run.sh +34 -0
- run_speech_recognition_ctc.py +0 -3
run.sh
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
python run_speech_recognition_ctc.py \
|
2 |
+
--dataset_name="mozilla-foundation/common_voice_8_0" \
|
3 |
+
--model_name_or_path="facebook/wav2vec2-xls-r-300m" \
|
4 |
+
--dataset_config_name="ab" \
|
5 |
+
--output_dir="./wav2vec2-large-xls-r-300m-abkhaz-cv8" \
|
6 |
+
--overwrite_output_dir \
|
7 |
+
--num_train_epochs="50" \
|
8 |
+
--per_device_train_batch_size="32" \
|
9 |
+
--per_device_eval_batch_size="16" \
|
10 |
+
--gradient_accumulation_steps="1" \
|
11 |
+
--learning_rate="7e-5" \
|
12 |
+
--warmup_steps="4000" \
|
13 |
+
--length_column_name="input_length" \
|
14 |
+
--evaluation_strategy="steps" \
|
15 |
+
--text_column_name="sentence" \
|
16 |
+
--chars_to_ignore , ? . ! \- \; \: \" “ % ‘ ” � — ’ … – \' \c \
|
17 |
+
--save_steps="4000" \
|
18 |
+
--eval_steps="4000" \
|
19 |
+
--logging_steps="1000" \
|
20 |
+
--layerdrop="0.0" \
|
21 |
+
--activation_dropout="0.1" \
|
22 |
+
--save_total_limit="2" \
|
23 |
+
--freeze_feature_encoder \
|
24 |
+
--feat_proj_dropout="0.0" \
|
25 |
+
--mask_time_prob="0.75" \
|
26 |
+
--mask_time_length="10" \
|
27 |
+
--mask_feature_prob="0.25" \
|
28 |
+
--mask_feature_length="64" \
|
29 |
+
--gradient_checkpointing \
|
30 |
+
--use_auth_token \
|
31 |
+
--fp16 \
|
32 |
+
--group_by_length \
|
33 |
+
--do_train --do_eval \
|
34 |
+
--push_to_hub
|
run_speech_recognition_ctc.py
CHANGED
@@ -444,9 +444,6 @@ def main():
|
|
444 |
batch["target_text"] = re.sub(chars_to_ignore_regex, "", batch[text_column_name]).lower() + " "
|
445 |
else:
|
446 |
batch["target_text"] = batch[text_column_name].lower() + " "
|
447 |
-
|
448 |
-
batch["target_text"] = batch[text_column_name].lower().replace('c', '')
|
449 |
-
|
450 |
return batch
|
451 |
|
452 |
with training_args.main_process_first(desc="dataset map special characters removal"):
|
|
|
444 |
batch["target_text"] = re.sub(chars_to_ignore_regex, "", batch[text_column_name]).lower() + " "
|
445 |
else:
|
446 |
batch["target_text"] = batch[text_column_name].lower() + " "
|
|
|
|
|
|
|
447 |
return batch
|
448 |
|
449 |
with training_args.main_process_first(desc="dataset map special characters removal"):
|