Training in progress, step 1000
Browse files- pytorch_model.bin +1 -1
- run.log +0 -0
- run_speech_recognition_seq2seq_streaming.py +30 -6
- runs/Dec20_04-28-50_129-146-123-136/events.out.tfevents.1671514074.129-146-123-136.2405293.0 +2 -2
- runs/Dec20_10-12-02_129-146-123-136/1671531744.4050705/events.out.tfevents.1671531744.129-146-123-136.3808886.1 +3 -0
- runs/Dec20_10-12-02_129-146-123-136/events.out.tfevents.1671531744.129-146-123-136.3808886.0 +3 -0
- training_args.bin +1 -1
pytorch_model.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 3086784957
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:66c2866840783f9227a6fe5132558e2be3d9e0497ec1651e9cce3a9a6bf89696
|
| 3 |
size 3086784957
|
run.log
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
run_speech_recognition_seq2seq_streaming.py
CHANGED
|
@@ -484,6 +484,33 @@ def main():
|
|
| 484 |
batch["labels"] = tokenizer(input_str).input_ids
|
| 485 |
return batch
|
| 486 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 487 |
def prepare_dataset_concatenated(batch):
|
| 488 |
"""
|
| 489 |
- ignoring do_lower_case, do_remove_punctuation
|
|
@@ -541,7 +568,9 @@ def main():
|
|
| 541 |
|
| 542 |
with training_args.main_process_first(desc="dataset map pre-processing"):
|
| 543 |
vectorized_datasets = raw_datasets.map(
|
| 544 |
-
|
|
|
|
|
|
|
| 545 |
remove_columns=raw_datasets_features,
|
| 546 |
).with_format("torch")
|
| 547 |
|
|
@@ -557,11 +586,6 @@ def main():
|
|
| 557 |
def is_audio_in_length_range(length):
|
| 558 |
return min_input_length < length < max_input_length
|
| 559 |
|
| 560 |
-
if training_args.do_train:
|
| 561 |
-
vectorized_datasets["train"] = vectorized_datasets["train"].filter(
|
| 562 |
-
is_audio_in_length_range,
|
| 563 |
-
input_columns=["input_length"],
|
| 564 |
-
)
|
| 565 |
|
| 566 |
# 8. Load Metric
|
| 567 |
metric = evaluate.load("wer")
|
|
|
|
| 484 |
batch["labels"] = tokenizer(input_str).input_ids
|
| 485 |
return batch
|
| 486 |
|
| 487 |
+
def prepare_dataset_bayar(batch):
|
| 488 |
+
MAX_LENGTH = 225
|
| 489 |
+
MAX_AUDIO_DURATION = 30
|
| 490 |
+
sample = batch[audio_column_name][0]
|
| 491 |
+
DEFAULT_SAMPLING_RATE = sample['sampling_rate']
|
| 492 |
+
|
| 493 |
+
bs = len(batch[text_column_name])
|
| 494 |
+
result = {'input_features': [], 'labels': []}
|
| 495 |
+
list_arr, list_text, total = [], [], 0
|
| 496 |
+
for i in range(bs + 1):
|
| 497 |
+
if i == bs or total + batch[audio_column_name][i]['array'].shape[0] / DEFAULT_SAMPLING_RATE > MAX_AUDIO_DURATION:
|
| 498 |
+
if total == 0: continue # because it could be evenly distributed when i == bs
|
| 499 |
+
tokens = tokenizer((' '.join(list_text))).input_ids
|
| 500 |
+
if len(tokens) > MAX_LENGTH: continue # too long -> might mislead to not-aligning problem
|
| 501 |
+
|
| 502 |
+
result['input_features'].append(feature_extractor(np.concatenate(list_arr), sampling_rate=DEFAULT_SAMPLING_RATE).input_features[0])
|
| 503 |
+
result['labels'].append(tokens)
|
| 504 |
+
# result['input_length'].append(len(np.concatenate(list_arr)))
|
| 505 |
+
list_arr, list_text, total = [], [], 0
|
| 506 |
+
if i < bs:
|
| 507 |
+
duration = batch[audio_column_name][i]['array'].shape[0] / DEFAULT_SAMPLING_RATE
|
| 508 |
+
if duration > MAX_AUDIO_DURATION: continue
|
| 509 |
+
total += duration
|
| 510 |
+
list_arr.append(batch[audio_column_name][i]['array'])
|
| 511 |
+
list_text.append(batch[text_column_name][i])
|
| 512 |
+
return result
|
| 513 |
+
|
| 514 |
def prepare_dataset_concatenated(batch):
|
| 515 |
"""
|
| 516 |
- ignoring do_lower_case, do_remove_punctuation
|
|
|
|
| 568 |
|
| 569 |
with training_args.main_process_first(desc="dataset map pre-processing"):
|
| 570 |
vectorized_datasets = raw_datasets.map(
|
| 571 |
+
prepare_dataset_bayar,
|
| 572 |
+
batched=True,
|
| 573 |
+
batch_size=64,
|
| 574 |
remove_columns=raw_datasets_features,
|
| 575 |
).with_format("torch")
|
| 576 |
|
|
|
|
| 586 |
def is_audio_in_length_range(length):
|
| 587 |
return min_input_length < length < max_input_length
|
| 588 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 589 |
|
| 590 |
# 8. Load Metric
|
| 591 |
metric = evaluate.load("wer")
|
runs/Dec20_04-28-50_129-146-123-136/events.out.tfevents.1671514074.129-146-123-136.2405293.0
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e53df992c9891d4248761877f6cbbdc67edcff1e69a48ce384178b8bed3cdef5
|
| 3 |
+
size 11179
|
runs/Dec20_10-12-02_129-146-123-136/1671531744.4050705/events.out.tfevents.1671531744.129-146-123-136.3808886.1
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a1ffebe9ce297b1b99ecd6dab7bbe24d7684379aea436f80a19a062561005daa
|
| 3 |
+
size 5881
|
runs/Dec20_10-12-02_129-146-123-136/events.out.tfevents.1671531744.129-146-123-136.3808886.0
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e271be54ec7c2ee8d4f866c1eb16c070ac31894fc81fc91f4ef9cfc7e61b5c99
|
| 3 |
+
size 10865
|
training_args.bin
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 4731
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b4e85ca367fa64bd161858b432c71b1ebc8ebc010d9d91fc0d176f9c5e1e9c0c
|
| 3 |
size 4731
|