Skip to content

Commit 43a6c3e

Browse files
committed
Run pre-commit hooks on all files
1 parent 14aee5d commit 43a6c3e

File tree

140 files changed

+4022
-2228
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+4022
-2228
lines changed

.gitattributes

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
data/lm/kenlm.scorer filter=lfs diff=lfs merge=lfs -text
2-
.github/actions/check_artifact_exists/dist/index.js binary
2+
.github/actions/check_artifact_exists/dist/index.js binary

.pre-commit-config.yaml

-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,3 @@ repos:
2222
- id: isort
2323
name: isort (pyi)
2424
types: [pyi]
25-
- repo: https://github.com/pycqa/pylint
26-
rev: v2.8.2
27-
hooks:
28-
- id: pylint

BIBLIOGRAPHY.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ This file contains a list of papers in chronological order that have been publis
33
To appear
44
==========
55

6-
* Raghuveer Peri, Haoqi Li, Krishna Somandepalli, Arindam Jati, Shrikanth Narayanan (2020) "An empirical analysis of information encoded in disentangled neural speaker representations".
6+
* Raghuveer Peri, Haoqi Li, Krishna Somandepalli, Arindam Jati, Shrikanth Narayanan (2020) "An empirical analysis of information encoded in disentangled neural speaker representations".
77
* Rosana Ardila, Megan Branson, Kelly Davis, Michael Henretty, Michael Kohler, Josh Meyer, Reuben Morais, Lindsay Saunders, Francis M. Tyers, and Gregor Weber (2020) "Common Voice: A Massively-Multilingual Speech Corpus".
88

9-
Published
9+
Published
1010
==========
1111

1212
2020
1313
----------
1414

15-
* Nils Hjortnaes, Niko Partanen, Michael Rießler and Francis M. Tyers (2020)
15+
* Nils Hjortnaes, Niko Partanen, Michael Rießler and Francis M. Tyers (2020)
1616
"Towards a Speech Recognizer for Komi, an Endangered and Low-Resource Uralic Language". *Proceedings of the 6th International Workshop on Computational Linguistics of Uralic Languages*.
1717

1818
```
@@ -72,5 +72,5 @@ Published
7272
booktitle = {2018 IEEE/ACM Machine Learning in HPC Environments (MLHPC)},
7373
doi = {https://doi.org/10.1109/MLHPC.2018.8638637}
7474
year = 2018
75-
}
75+
}
7676
```

CODE_OF_CONDUCT.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118118
version 2.0, available at
119119
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
120120

121-
Community Impact Guidelines were inspired by
121+
Community Impact Guidelines were inspired by
122122
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123123

124124
For answers to common questions about this code of conduct, see the FAQ at
125-
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
125+
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
126126
at [https://www.contributor-covenant.org/translations][translations].
127127

128128
[homepage]: https://www.contributor-covenant.org

CODE_OWNERS.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,5 @@ Documentation
112112

113113
.. Third party bindings
114114
--------------------
115-
115+
116116
Hosted externally and owned by the individual authors. See the `list of third-party bindings <https://stt.readthedocs.io/en/latest/ USING.html#third-party-bindings>`_ for more info.

Dockerfile.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Please refer to the USING documentation, "Dockerfile for building from source"
22

3-
# Need devel version cause we need /usr/include/cudnn.h
3+
# Need devel version cause we need /usr/include/cudnn.h
44
FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04
55

66
ARG STT_REPO=https://github.com/coqui-ai/STT.git

README.rst

+12-13
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
.. |covenant-img| image:: https://img.shields.io/badge/Contributor%20Covenant-2.0-4baaaa.svg
1010
:target: CODE_OF_CONDUCT.md
1111
:alt: Contributor Covenant
12-
12+
1313
.. |gitter-img| image:: https://badges.gitter.im/coqui-ai/STT.svg
1414
:target: https://gitter.im/coqui-ai/STT?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge
1515
:alt: Gitter Room
16-
16+
1717
.. |doi| image:: https://zenodo.org/badge/344354127.svg
1818
:target: https://zenodo.org/badge/latestdoi/344354127
19-
19+
2020
|doc-img| |covenant-img| |gitter-img| |doi|
2121

2222
`👉 Subscribe to 🐸Coqui's Newsletter <https://coqui.ai/?subscription=true>`_
@@ -31,16 +31,16 @@
3131
* Streaming inference.
3232
* Multiple possible transcripts, each with an associated confidence score.
3333
* Real-time inference.
34-
* Small-footprint acoustic model.
35-
* Bindings for various programming languages.
34+
* Small-footprint acoustic model.
35+
* Bindings for various programming languages.
3636

3737
Where to Ask Questions
3838
----------------------
3939

4040
.. list-table::
41-
:widths: 25 25
41+
:widths: 25 25
4242
:header-rows: 1
43-
43+
4444
* - Type
4545
- Link
4646
* - 🚨 **Bug Reports**
@@ -51,14 +51,14 @@ Where to Ask Questions
5151
- `Github Discussions <https://github.com/coqui-ai/stt/discussions/>`_
5252
* - 💬 **General Discussion**
5353
- `Github Discussions <https://github.com/coqui-ai/stt/discussions/>`_ or `Gitter Room <https://gitter.im/coqui-ai/STT?utm_source=share-link&utm_medium=link&utm_campaign=share-link>`_
54-
55-
54+
55+
5656
Links & Resources
5757
-----------------
58-
.. list-table::
59-
:widths: 25 25
58+
.. list-table::
59+
:widths: 25 25
6060
:header-rows: 1
61-
61+
6262
* - Type
6363
- Link
6464
* - 📰 **Documentation**
@@ -67,4 +67,3 @@ Links & Resources
6767
- `see the latest release on GitHub <https://github.com/coqui-ai/STT/releases/latest>`_
6868
* - 🤝 **Contribution Guidelines**
6969
- `CONTRIBUTING.rst <CONTRIBUTING.rst>`_
70-

bazel.patch

+14-14
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,23 @@ index c7aa4cb63..e084bc27c 100644
99
+import java.io.PrintWriter;
1010
import java.util.zip.GZIPInputStream;
1111
import java.util.zip.GZIPOutputStream;
12-
12+
1313
@@ -73,6 +74,8 @@ public final class FileWriteAction extends AbstractFileWriteAction {
1414
*/
1515
private final CharSequence fileContents;
16-
16+
1717
+ private final Artifact output;
1818
+
1919
/** Minimum length (in chars) for content to be eligible for compression. */
2020
private static final int COMPRESS_CHARS_THRESHOLD = 256;
21-
21+
2222
@@ -90,6 +93,7 @@ public final class FileWriteAction extends AbstractFileWriteAction {
2323
fileContents = new CompressedString((String) fileContents);
2424
}
2525
this.fileContents = fileContents;
2626
+ this.output = output;
2727
}
28-
28+
2929
/**
3030
@@ -230,11 +234,32 @@ public final class FileWriteAction extends AbstractFileWriteAction {
3131
*/
@@ -59,7 +59,7 @@ index c7aa4cb63..e084bc27c 100644
5959
+ computeKeyDebugWriter.close();
6060
+ return rv;
6161
}
62-
62+
6363
/**
6464
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java b/src/main/java/com/google/devtools/build/lib/analysis/actions/SpawnAction.java
6565
index 580788160..26883eb92 100644
@@ -74,9 +74,9 @@ index 580788160..26883eb92 100644
7474
import java.util.Collections;
7575
import java.util.LinkedHashMap;
7676
@@ -91,6 +92,9 @@ public class SpawnAction extends AbstractAction implements ExecutionInfoSpecifie
77-
77+
7878
private final CommandLine argv;
79-
79+
8080
+ private final Iterable<Artifact> inputs;
8181
+ private final Iterable<Artifact> outputs;
8282
+
@@ -91,10 +91,10 @@ index 580788160..26883eb92 100644
9191
+ this.inputs = inputs;
9292
+ this.outputs = outputs;
9393
}
94-
94+
9595
@Override
9696
@@ -312,23 +319,89 @@ public class SpawnAction extends AbstractAction implements ExecutionInfoSpecifie
97-
97+
9898
@Override
9999
protected String computeKey() {
100100
+ boolean genruleSetup = String.valueOf(Iterables.get(inputs, 0).getExecPath()).contains("genrule/genrule-setup.sh");
@@ -182,14 +182,14 @@ index 580788160..26883eb92 100644
182182
+ }
183183
+ return rv;
184184
}
185-
185+
186186
@Override
187187
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java
188188
index 3559fffde..3ba39617c 100644
189189
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java
190190
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileAction.java
191191
@@ -1111,10 +1111,30 @@ public class CppCompileAction extends AbstractAction
192-
192+
193193
@Override
194194
public String computeKey() {
195195
+ // ".ckd" Compute Key Debug
@@ -216,7 +216,7 @@ index 3559fffde..3ba39617c 100644
216216
+ for (Map.Entry<String, String> entry : executionInfo.entrySet()) {
217217
+ computeKeyDebugWriter.println("EXECINFO: " + entry.getKey() + "=" + entry.getValue());
218218
+ }
219-
219+
220220
// For the argv part of the cache key, ignore all compiler flags that explicitly denote module
221221
// file (.pcm) inputs. Depending on input discovery, some of the unused ones are removed from
222222
@@ -1124,6 +1144,9 @@ public class CppCompileAction extends AbstractAction
@@ -226,7 +226,7 @@ index 3559fffde..3ba39617c 100644
226226
+ for (String input : compileCommandLine.getArgv(getInternalOutputFile(), null)) {
227227
+ computeKeyDebugWriter.println("COMMAND: " + input);
228228
+ }
229-
229+
230230
/*
231231
* getArgv() above captures all changes which affect the compilation
232232
@@ -1133,19 +1156,31 @@ public class CppCompileAction extends AbstractAction
@@ -260,5 +260,5 @@ index 3559fffde..3ba39617c 100644
260260
+ computeKeyDebugWriter.close();
261261
+ return rv;
262262
}
263-
263+
264264
@Override

bin/compare_samples.py

+24-10
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"""
33
Tool for comparing two wav samples
44
"""
5-
import sys
65
import argparse
7-
import numpy as np
6+
import sys
87

8+
import numpy as np
99
from coqui_stt_training.util.audio import AUDIO_TYPE_NP, mean_dbfs
1010
from coqui_stt_training.util.sample_collections import load_sample
1111

@@ -19,19 +19,29 @@ def compare_samples():
1919
sample1 = load_sample(CLI_ARGS.sample1).unpack()
2020
sample2 = load_sample(CLI_ARGS.sample2).unpack()
2121
if sample1.audio_format != sample2.audio_format:
22-
fail('Samples differ on: audio-format ({} and {})'.format(sample1.audio_format, sample2.audio_format))
22+
fail(
23+
"Samples differ on: audio-format ({} and {})".format(
24+
sample1.audio_format, sample2.audio_format
25+
)
26+
)
2327
if abs(sample1.duration - sample2.duration) > 0.001:
24-
fail('Samples differ on: duration ({} and {})'.format(sample1.duration, sample2.duration))
28+
fail(
29+
"Samples differ on: duration ({} and {})".format(
30+
sample1.duration, sample2.duration
31+
)
32+
)
2533
sample1.change_audio_type(AUDIO_TYPE_NP)
2634
sample2.change_audio_type(AUDIO_TYPE_NP)
2735
samples = [sample1, sample2]
2836
largest = np.argmax([sample1.audio.shape[0], sample2.audio.shape[0]])
2937
smallest = (largest + 1) % 2
30-
samples[largest].audio = samples[largest].audio[:len(samples[smallest].audio)]
38+
samples[largest].audio = samples[largest].audio[: len(samples[smallest].audio)]
3139
audio_diff = samples[largest].audio - samples[smallest].audio
3240
diff_dbfs = mean_dbfs(audio_diff)
33-
differ_msg = 'Samples differ on: sample data ({:0.2f} dB difference) '.format(diff_dbfs)
34-
equal_msg = 'Samples are considered equal ({:0.2f} dB difference)'.format(diff_dbfs)
41+
differ_msg = "Samples differ on: sample data ({:0.2f} dB difference) ".format(
42+
diff_dbfs
43+
)
44+
equal_msg = "Samples are considered equal ({:0.2f} dB difference)".format(diff_dbfs)
3545
if CLI_ARGS.if_differ:
3646
if diff_dbfs <= CLI_ARGS.threshold:
3747
fail(equal_msg)
@@ -50,13 +60,17 @@ def handle_args():
5060
)
5161
parser.add_argument("sample1", help="Filename of sample 1 to compare")
5262
parser.add_argument("sample2", help="Filename of sample 2 to compare")
53-
parser.add_argument("--threshold", type=float, default=-60.0,
54-
help="dB of sample deltas above which they are considered different")
63+
parser.add_argument(
64+
"--threshold",
65+
type=float,
66+
default=-60.0,
67+
help="dB of sample deltas above which they are considered different",
68+
)
5569
parser.add_argument(
5670
"--if-differ",
5771
action="store_true",
5872
help="If to succeed and return status code 0 on different signals and fail on equal ones (inverse check)."
59-
"This will still fail on different formats or durations.",
73+
"This will still fail on different formats or durations.",
6074
)
6175
parser.add_argument(
6276
"--no-success-output",

0 commit comments

Comments
 (0)