Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
asumagic committed May 16, 2024
1 parent 76f21cd commit 1f1ccc2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Model: wav2vec2 + DNN + CTC + LM (k2)
# Augmentation: SpecAugment + Speed
# Authors: Pierre Champion 2023
Expand Down
4 changes: 3 additions & 1 deletion tests/consistency/test_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ def test_yaml_script_consistency(recipe_folder="tests/recipes"):
check_yaml_vs_script(row["Hparam_file"], row["Script_file"])
):
check = False
text = f"Error for {row['Hparam_file']} - {row['Script_file']}"
text = (
f"Error for {row['Hparam_file']} - {row['Script_file']}"
)

# Check module variables
# if not (check_module_vars(row["Hparam_file"], row["Script_file"])):
Expand Down
13 changes: 7 additions & 6 deletions tests/utils/check_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"""

import os
import sys
import re
import sys

from speechbrain.core import run_opt_defaults

Expand Down Expand Up @@ -111,7 +111,7 @@ def detect_script_vars(script_file, var_lst):
print(
"\t\tWARNING: potential inconsistency %s maybe used in %s (or not)."
% (var, re_match.group(0)),
file=sys.stderr
file=sys.stderr,
)
if var not in detected_var:
detected_var.append(var)
Expand All @@ -124,7 +124,7 @@ def detect_script_vars(script_file, var_lst):
print(
"\t\tWARNING: potential inconsistency %s maybe used in %s (or not)."
% (var, re_match.group(0)),
file=sys.stderr
file=sys.stderr,
)
if var not in detected_var:
detected_var.append(var)
Expand Down Expand Up @@ -195,8 +195,9 @@ def check_yaml_vs_script(hparam_file, script_file):
)
for unused_var in unused_vars:
print(
'\tERROR: variable "%s" not used in %s!' % (unused_var, script_file),
file=sys.stderr
'\tERROR: variable "%s" not used in %s!'
% (unused_var, script_file),
file=sys.stderr,
)

return len(unused_vars) == 0
Expand Down Expand Up @@ -312,6 +313,6 @@ def check_module_vars(
print(
'\tERROR: variable "self.modules.%s" used in %s, but not listed in the "modules:" section of %s'
% (unused_var, script_file, hparam_file),
file=sys.stderr
file=sys.stderr,
)
return len(unused_vars) == 0

0 comments on commit 1f1ccc2

Please sign in to comment.