Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
parler-tts
Commits
b03a236d
"include/vscode:/vscode.git/clone" did not exist on "67f39ad17a16b9f1a7e6658b6325601905872953"
Commit
b03a236d
authored
Feb 16, 2024
by
sanchit-gandhi
Browse files
always filter by max len
parent
b73698c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
run_audio_classification.py
run_audio_classification.py
+4
-3
No files found.
run_audio_classification.py
View file @
b03a236d
...
...
@@ -171,11 +171,11 @@ class DataTrainingArguments:
)
},
)
max_length_seconds
:
float
=
field
(
max_length_seconds
:
Optional
[
float
]
=
field
(
default
=
20
,
metadata
=
{
"help"
:
"Audio samples will be randomly cut to this length during training if the value is set."
},
)
min_length_seconds
:
float
=
field
(
min_length_seconds
:
Optional
[
float
]
=
field
(
default
=
5
,
metadata
=
{
"help"
:
"Audio samples less than this value will be filtered during training if the value is set."
},
)
...
...
@@ -551,10 +551,11 @@ def main():
)
# filter training data with inputs < min_input_length
max_input_length
=
data_args
.
max_length_seconds
*
sampling_rate
min_input_length
=
data_args
.
min_length_seconds
*
sampling_rate
def
is_audio_valid
(
audio
):
return
len
(
audio
[
"array"
])
>
min_input_length
return
max_input_length
>
len
(
audio
[
"array"
])
>
min_input_length
raw_datasets
=
raw_datasets
.
filter
(
is_audio_valid
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment