Skip to content

Commit

Permalink
Re-run linter over files after update
Browse files Browse the repository at this point in the history
  • Loading branch information
reuben committed Feb 28, 2022
1 parent d5d9904 commit 46b230b
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 35 deletions.
8 changes: 4 additions & 4 deletions bin/import_atthack.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,13 @@ def get_sample_size(population_size):
margin_of_error = 0.01
fraction_picking = 0.50
z_score = 2.58 # Corresponds to confidence level 99%
numerator = (z_score ** 2 * fraction_picking * (1 - fraction_picking)) / (
margin_of_error ** 2
numerator = (z_score**2 * fraction_picking * (1 - fraction_picking)) / (
margin_of_error**2
)
sample_size = 0
for train_size in range(population_size, 0, -1):
denominator = 1 + (z_score ** 2 * fraction_picking * (1 - fraction_picking)) / (
margin_of_error ** 2 * train_size
denominator = 1 + (z_score**2 * fraction_picking * (1 - fraction_picking)) / (
margin_of_error**2 * train_size
)
sample_size = int(numerator / denominator)
if 2 * sample_size + train_size <= population_size:
Expand Down
8 changes: 4 additions & 4 deletions bin/import_ccpmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,13 +754,13 @@ def get_sample_size(population_size):
margin_of_error = 0.01
fraction_picking = 0.50
z_score = 2.58 # Corresponds to confidence level 99%
numerator = (z_score ** 2 * fraction_picking * (1 - fraction_picking)) / (
margin_of_error ** 2
numerator = (z_score**2 * fraction_picking * (1 - fraction_picking)) / (
margin_of_error**2
)
sample_size = 0
for train_size in range(population_size, 0, -1):
denominator = 1 + (z_score ** 2 * fraction_picking * (1 - fraction_picking)) / (
margin_of_error ** 2 * train_size
denominator = 1 + (z_score**2 * fraction_picking * (1 - fraction_picking)) / (
margin_of_error**2 * train_size
)
sample_size = int(numerator / denominator)
if 2 * sample_size + train_size <= population_size:
Expand Down
2 changes: 1 addition & 1 deletion bin/import_cv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def init_worker(params):


def one_sample(sample):
""" Take an audio file, and optionally convert it to 16kHz WAV """
"""Take an audio file, and optionally convert it to 16kHz WAV"""
mp3_filename = sample[0]
if not os.path.splitext(mp3_filename.lower())[1] == ".mp3":
mp3_filename += ".mp3"
Expand Down
2 changes: 1 addition & 1 deletion bin/import_cv_personal.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def init_worker(params):


def one_sample(sample):
""" Take an audio file, and optionally convert it to 16kHz WAV """
"""Take an audio file, and optionally convert it to 16kHz WAV"""
mp3_filename = sample[0]
# Storing wav files next to the mp3 ones - just with a different suffix
wav_filename = os.path.splitext(mp3_filename)[0] + ".wav"
Expand Down
8 changes: 4 additions & 4 deletions bin/import_fisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,13 +264,13 @@ def get_sample_size(population_size):
margin_of_error = 0.01
fraction_picking = 0.50
z_score = 2.58 # Corresponds to confidence level 99%
numerator = (z_score ** 2 * fraction_picking * (1 - fraction_picking)) / (
margin_of_error ** 2
numerator = (z_score**2 * fraction_picking * (1 - fraction_picking)) / (
margin_of_error**2
)
sample_size = 0
for train_size in range(population_size, 0, -1):
denominator = 1 + (z_score ** 2 * fraction_picking * (1 - fraction_picking)) / (
margin_of_error ** 2 * train_size
denominator = 1 + (z_score**2 * fraction_picking * (1 - fraction_picking)) / (
margin_of_error**2 * train_size
)
sample_size = int(numerator / denominator)
if 2 * sample_size + train_size <= population_size:
Expand Down
2 changes: 1 addition & 1 deletion bin/import_lingua_libre.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def _maybe_extract(target_dir, extracted_data, archive_path):


def one_sample(sample):
""" Take a audio file, and optionally convert it to 16kHz WAV """
"""Take a audio file, and optionally convert it to 16kHz WAV"""
ogg_filename = sample[0]
# Storing wav files next to the ogg ones - just with a different suffix
wav_filename = os.path.splitext(ogg_filename)[0] + ".wav"
Expand Down
8 changes: 4 additions & 4 deletions bin/import_swb.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,13 @@ def get_sample_size(population_size):
margin_of_error = 0.01
fraction_picking = 0.50
z_score = 2.58 # Corresponds to confidence level 99%
numerator = (z_score ** 2 * fraction_picking * (1 - fraction_picking)) / (
margin_of_error ** 2
numerator = (z_score**2 * fraction_picking * (1 - fraction_picking)) / (
margin_of_error**2
)
sample_size = 0
for train_size in range(population_size, 0, -1):
denominator = 1 + (z_score ** 2 * fraction_picking * (1 - fraction_picking)) / (
margin_of_error ** 2 * train_size
denominator = 1 + (z_score**2 * fraction_picking * (1 - fraction_picking)) / (
margin_of_error**2 * train_size
)
sample_size = int(numerator / denominator)
if 2 * sample_size + train_size <= population_size:
Expand Down
8 changes: 4 additions & 4 deletions bin/import_swc.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ def get_sample_size(population_size):
margin_of_error = 0.01
fraction_picking = 0.50
z_score = 2.58 # Corresponds to confidence level 99%
numerator = (z_score ** 2 * fraction_picking * (1 - fraction_picking)) / (
margin_of_error ** 2
numerator = (z_score**2 * fraction_picking * (1 - fraction_picking)) / (
margin_of_error**2
)
sample_size = 0
for train_size in range(population_size, 0, -1):
denominator = 1 + (z_score ** 2 * fraction_picking * (1 - fraction_picking)) / (
margin_of_error ** 2 * train_size
denominator = 1 + (z_score**2 * fraction_picking * (1 - fraction_picking)) / (
margin_of_error**2 * train_size
)
sample_size = int(numerator / denominator)
if 2 * sample_size + train_size <= population_size:
Expand Down
2 changes: 1 addition & 1 deletion data/lm/generate_lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


def convert_and_filter_topk(args):
""" Convert to lowercase, count word occurrences and save top-k words to a file """
"""Convert to lowercase, count word occurrences and save top-k words to a file"""

counter = Counter()
data_lower = os.path.join(args.output_dir, "lower.txt.gz")
Expand Down
8 changes: 4 additions & 4 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

# -- Project information -----------------------------------------------------

project = u"Coqui STT"
project = "Coqui STT"
copyright = "2021 Coqui GmbH, 2020 DeepSpeech authors, 2019-2020 Mozilla Corporation"
author = "Coqui GmbH"

Expand Down Expand Up @@ -179,15 +179,15 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, "STT.tex", u"Coqui STT Documentation", u"Coqui GmbH", "manual"),
(master_doc, "STT.tex", "Coqui STT Documentation", "Coqui GmbH", "manual"),
]


# -- Options for manual page output ---------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, "stt", u"Coqui STT Documentation", [author], 1)]
man_pages = [(master_doc, "stt", "Coqui STT Documentation", [author], 1)]


# -- Options for Texinfo output -------------------------------------------
Expand All @@ -199,7 +199,7 @@
(
master_doc,
"STT",
u"Coqui STT Documentation",
"Coqui STT Documentation",
author,
"STT",
"One line description of project.",
Expand Down
8 changes: 4 additions & 4 deletions training/coqui_stt_training/util/auto_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ def _get_sample_size(population_size):
margin_of_error = 0.01
fraction_picking = 0.50
z_score = 2.58 # Corresponds to confidence level 99%
numerator = (z_score ** 2 * fraction_picking * (1 - fraction_picking)) / (
margin_of_error ** 2
numerator = (z_score**2 * fraction_picking * (1 - fraction_picking)) / (
margin_of_error**2
)
sample_size = 0
for train_size in range(population_size, 0, -1):
denominator = 1 + (z_score ** 2 * fraction_picking * (1 - fraction_picking)) / (
margin_of_error ** 2 * train_size
denominator = 1 + (z_score**2 * fraction_picking * (1 - fraction_picking)) / (
margin_of_error**2 * train_size
)
sample_size = int(numerator / denominator)
if 2 * sample_size + train_size <= population_size:
Expand Down
2 changes: 1 addition & 1 deletion training/coqui_stt_training/util/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -872,7 +872,7 @@ def initialize_globals_from_args(**override_args):


def initialize_globals_from_instance(config):
""" Initialize Config singleton from an existing instance """
"""Initialize Config singleton from an existing instance"""
_ConfigSingleton._config = config # pylint: disable=protected-access


Expand Down
2 changes: 1 addition & 1 deletion training/coqui_stt_training/util/evaluate_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def calculate_and_print_report(


def print_report(samples, losses, wer, cer, dataset_name, report_count=5):
""" Print a report summary and samples of best, median and worst results """
"""Print a report summary and samples of best, median and worst results"""

# Print summary
mean_loss = np.mean(losses)
Expand Down
2 changes: 1 addition & 1 deletion training/coqui_stt_training/util/lm_optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def compute_lm_optimization() -> dict:
study = optuna.create_study()
study.set_user_attr("is_character_based", is_character_based)
study.optimize(objective, n_jobs=1, n_trials=Config.n_trials)

return {
"lm_alpha": study.best_params.get("lm_alpha"),
"lm_beta": study.best_params.get("lm_beta"),
Expand Down

0 comments on commit 46b230b

Please sign in to comment.