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
hehl2
Torchaudio
Commits
6bad3a66
"scripts/npu_ci_install_dependency.sh" did not exist on "1fc455e8b65f0fcbe5d1c41ac5868667650317c9"
Unverified
Commit
6bad3a66
authored
Mar 16, 2021
by
Ankit Dobhal
Committed by
GitHub
Mar 16, 2021
Browse files
Lint code style and remove PY2 compatibility (#1386)
parent
f06074aa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
4 deletions
+4
-4
examples/interactive_asr/vad.py
examples/interactive_asr/vad.py
+2
-2
examples/pipeline_wav2letter/languagemodels.py
examples/pipeline_wav2letter/languagemodels.py
+1
-1
test/torchaudio_unittest/compliance_kaldi_test.py
test/torchaudio_unittest/compliance_kaldi_test.py
+1
-1
No files found.
examples/interactive_asr/vad.py
View file @
6bad3a66
...
...
@@ -35,7 +35,7 @@ def compute_spectral_flatness(frame, epsilon=0.01):
return
-
10
*
torch
.
log10
(
epsilon
+
geometric_mean
/
arithmetic_mean
)
class
VoiceActivityDetection
(
object
)
:
class
VoiceActivityDetection
:
def
__init__
(
self
,
num_init_frames
=
30
,
...
...
@@ -148,7 +148,7 @@ class VoiceActivityDetection(object):
return
self
.
silence_mark
class
MicrophoneStream
(
object
)
:
class
MicrophoneStream
:
"""Opens a recording stream as a generator yielding the audio chunks."""
def
__init__
(
self
,
device
=
None
,
rate
=
22050
,
chunk
=
2205
):
...
...
examples/pipeline_wav2letter/languagemodels.py
View file @
6bad3a66
...
...
@@ -8,7 +8,7 @@ class LanguageModel:
self
.
char_space
=
char_space
self
.
char_blank
=
char_blank
labels
=
[
l
for
l
in
labels
]
labels
=
list
(
labels
)
self
.
length
=
len
(
labels
)
enumerated
=
list
(
enumerate
(
labels
))
flipped
=
[(
sub
[
1
],
sub
[
0
])
for
sub
in
enumerated
]
...
...
test/torchaudio_unittest/compliance_kaldi_test.py
View file @
6bad3a66
...
...
@@ -156,7 +156,7 @@ class Test_Kaldi(common_utils.TempDirMixin, common_utils.TorchaudioTestCase):
# Read kaldi's output from file
kaldi_output_path
=
os
.
path
.
join
(
self
.
kaldi_output_dir
,
f
)
kaldi_output_dict
=
{
k
:
v
for
k
,
v
in
torchaudio
.
kaldi_io
.
read_mat_ark
(
kaldi_output_path
)
}
kaldi_output_dict
=
dict
(
torchaudio
.
kaldi_io
.
read_mat_ark
(
kaldi_output_path
)
)
assert
len
(
kaldi_output_dict
)
==
1
and
'my_id'
in
kaldi_output_dict
,
'invalid test kaldi ark file'
kaldi_output
=
kaldi_output_dict
[
'my_id'
]
...
...
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