Skip to content

Commit be0d9e0

Browse files
committed
Fix import statement ordering using isort
1 parent 605278b commit be0d9e0

461 files changed

Lines changed: 2091 additions & 1532 deletions

File tree

Some content is hidden

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

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ repos:
1919
- id: black
2020
types: [python]
2121
additional_dependencies: ['click==8.1.7']
22+
2223
- repo: https://github.com/PyCQA/flake8
2324
rev: 7.0.0
2425
hooks:
@@ -37,3 +38,8 @@ repos:
3738
args: [--ignore-words=.dict-speechbrain.txt]
3839
additional_dependencies:
3940
- tomli
41+
42+
- repo: https://github.com/pycqa/isort
43+
rev: 5.13.2
44+
hooks:
45+
- id: isort

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#
1313
import os
1414
import sys
15+
1516
import hyperpyyaml
1617

1718
sys.path.insert(-1, os.path.abspath("../"))

lint-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
black==24.3.0
22
click==8.1.7
33
flake8==7.0.0
4+
isort==5.13.2
45
pycodestyle==2.11.0
56
pydoclint==0.4.1
67
pytest==7.4.0

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,8 @@ exclude = '''
1616

1717
[tool.codespell]
1818
skip = "./tests/tmp,./**/result,*.csv,*train.txt,*test.txt"
19+
20+
[tool.isort]
21+
profile = "black"
22+
line_length = 80
23+
filter_files = true

recipes/AISHELL-1/ASR/CTC/train_with_wav2vec.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@
1414
* Yingzhi WANG 2022
1515
"""
1616

17+
import logging
1718
import sys
19+
1820
import torch
19-
import logging
21+
from hyperpyyaml import load_hyperpyyaml
22+
2023
import speechbrain as sb
2124
from speechbrain.utils.distributed import run_on_main
22-
from hyperpyyaml import load_hyperpyyaml
2325

2426
logger = logging.getLogger(__name__)
2527

recipes/AISHELL-1/ASR/seq2seq/train.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
AISHELL-1 seq2seq model recipe. (Adapted from the LibriSpeech recipe.)
44
"""
55

6+
import logging
67
import sys
8+
79
import torch
8-
import logging
10+
from hyperpyyaml import load_hyperpyyaml
11+
912
import speechbrain as sb
1013
from speechbrain.utils.distributed import run_on_main
11-
from hyperpyyaml import load_hyperpyyaml
1214

1315
logger = logging.getLogger(__name__)
1416

recipes/AISHELL-1/ASR/transformer/train.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@
88
* Titouan Parcollet 2021
99
"""
1010

11+
import logging
1112
import sys
13+
1214
import torch
13-
import logging
15+
from hyperpyyaml import load_hyperpyyaml
16+
1417
import speechbrain as sb
1518
from speechbrain.utils.distributed import run_on_main
16-
from hyperpyyaml import load_hyperpyyaml
1719

1820
logger = logging.getLogger(__name__)
1921

recipes/AISHELL-1/ASR/transformer/train_with_wav2vect.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
77
"""
88

9+
import logging
910
import sys
11+
1012
import torch
11-
import logging
13+
from hyperpyyaml import load_hyperpyyaml
14+
1215
import speechbrain as sb
1316
from speechbrain.utils.distributed import run_on_main
14-
from hyperpyyaml import load_hyperpyyaml
1517

1618
logger = logging.getLogger(__name__)
1719

recipes/AISHELL-1/Tokenizer/pretrained.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@
77
"""
88

99
import os
10-
from speechbrain.utils.data_utils import download_file
10+
1111
import sentencepiece as spm
1212

13+
from speechbrain.utils.data_utils import download_file
14+
1315

1416
class tokenizer:
1517
"""Downloads and loads the pretrained tokenizer.

recipes/AISHELL-1/Tokenizer/train.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
"""
1515

1616
import sys
17-
import speechbrain as sb
17+
1818
from hyperpyyaml import load_hyperpyyaml
19+
20+
import speechbrain as sb
1921
from speechbrain.utils.distributed import run_on_main
2022

2123
if __name__ == "__main__":

0 commit comments

Comments
 (0)