Skip to content

Commit

Permalink
[AutoAccept][Codemod][FBSourceBlackLinter] Daily arc lint --take BLACK
Browse files Browse the repository at this point in the history
Summary:
Meta:
**If you take no action, this diff will be automatically accepted on 2022-06-23.**
(To remove yourself from auto-accept diffs and just let them all land, add yourself to [this Butterfly rule](https://www.internalfb.com/butterfly/rule/904302247110220))

Produced by `tools/arcanist/lint/codemods/black-fbsource`.

#nocancel

Rules run:
- CodemodTransformerSimpleShell

Config Oncall: [lint](https://our.intern.facebook.com/intern/oncall3/?shortname=lint)
CodemodConfig: [CodemodConfigFBSourceBlackLinter](https://www.internalfb.com/code/www/flib/intern/codemod_service/config/fbsource_arc_f/CodemodConfigFBSourceBlackLinter.php)
ConfigType: php
Sandcastle URL: https://www.internalfb.com/intern/sandcastle/job/13510799586951394/
This diff was automatically created with CodemodService.
To learn more about CodemodService, check out the [CodemodService wiki](https://fburl.com/CodemodService).

_____

## Questions / Comments / Feedback?

**[Click here to give feedback about this diff](https://www.internalfb.com/codemod_service/feedback?sandcastle_job_id=13510799586951394).**

* Returning back to author or abandoning this diff will only cause the diff to be regenerated in the future.
* Do **NOT** post in the CodemodService Feedback group about this specific diff.

drop-conflicts

Reviewed By: adamjernst

Differential Revision: D37375235

fbshipit-source-id: 3d7eb39e5c0539a78d1412f37562dec90b0fc759
  • Loading branch information
CodemodService FBSourceBlackLinterBot authored and facebook-github-bot committed Jun 23, 2022
1 parent b92a8a0 commit fee994c
Show file tree
Hide file tree
Showing 46 changed files with 51 additions and 289 deletions.
5 changes: 1 addition & 4 deletions examples/asr/emformer_rnnt/pipeline_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
from common import MODEL_TYPE_LIBRISPEECH, MODEL_TYPE_MUSTC, MODEL_TYPE_TEDLIUM3
from mustc.dataset import MUSTC
from torchaudio.pipelines import EMFORMER_RNNT_BASE_LIBRISPEECH, RNNTBundle
from torchaudio.prototype.pipelines import (
EMFORMER_RNNT_BASE_MUSTC,
EMFORMER_RNNT_BASE_TEDLIUM3,
)
from torchaudio.prototype.pipelines import EMFORMER_RNNT_BASE_MUSTC, EMFORMER_RNNT_BASE_TEDLIUM3

logger = logging.getLogger(__name__)

Expand Down
6 changes: 1 addition & 5 deletions examples/hubert/finetune.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@

import logging
import pathlib
from argparse import (
ArgumentDefaultsHelpFormatter,
ArgumentParser,
RawDescriptionHelpFormatter,
)
from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser, RawDescriptionHelpFormatter
from typing import Tuple

from lightning import HuBERTFineTuneModule
Expand Down
6 changes: 1 addition & 5 deletions examples/hubert/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,7 @@

import logging
import pathlib
from argparse import (
ArgumentDefaultsHelpFormatter,
ArgumentParser,
RawDescriptionHelpFormatter,
)
from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser, RawDescriptionHelpFormatter
from typing import Optional, Tuple

from lightning import HuBERTPreTrainModule
Expand Down
7 changes: 1 addition & 6 deletions examples/interactive_asr/asr.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,7 @@
import logging

from fairseq import options
from interactive_asr.utils import (
add_asr_eval_argument,
get_microphone_transcription,
setup_asr,
transcribe_file,
)
from interactive_asr.utils import add_asr_eval_argument, get_microphone_transcription, setup_asr, transcribe_file


def main(args):
Expand Down
15 changes: 3 additions & 12 deletions examples/pipeline_tacotron2/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@
import torch
import torchaudio
from datasets import InverseSpectralNormalization
from text.text_preprocessing import (
available_phonemizers,
available_symbol_set,
get_symbol_list,
text_to_sequence,
)
from text.text_preprocessing import available_phonemizers, available_symbol_set, get_symbol_list, text_to_sequence
from torchaudio.models import Tacotron2, tacotron2 as pretrained_tacotron2
from utils import prepare_input_sequence

Expand All @@ -26,12 +21,8 @@ def parse_args():
r"""
Parse commandline arguments.
"""
from torchaudio.models.tacotron2 import (
_MODEL_CONFIG_AND_URLS as tacotron2_config_and_urls,
)
from torchaudio.models.wavernn import (
_MODEL_CONFIG_AND_URLS as wavernn_config_and_urls,
)
from torchaudio.models.tacotron2 import _MODEL_CONFIG_AND_URLS as tacotron2_config_and_urls
from torchaudio.models.wavernn import _MODEL_CONFIG_AND_URLS as wavernn_config_and_urls

parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
Expand Down
7 changes: 1 addition & 6 deletions examples/pipeline_tacotron2/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,7 @@

from datasets import SpectralNormalization, split_process_dataset, text_mel_collate_fn
from loss import Tacotron2Loss
from text.text_preprocessing import (
available_phonemizers,
available_symbol_set,
get_symbol_list,
text_to_sequence,
)
from text.text_preprocessing import available_phonemizers, available_symbol_set, get_symbol_list, text_to_sequence
from utils import save_checkpoint


Expand Down
8 changes: 1 addition & 7 deletions test/torchaudio_unittest/backend/sox_io/roundtrip_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@

from parameterized import parameterized
from torchaudio.backend import sox_io_backend
from torchaudio_unittest.common_utils import (
get_wav_data,
PytorchTestCase,
skipIfNoExec,
skipIfNoSox,
TempDirMixin,
)
from torchaudio_unittest.common_utils import get_wav_data, PytorchTestCase, skipIfNoExec, skipIfNoSox, TempDirMixin

from .common import get_enc_params, name_func

Expand Down
7 changes: 1 addition & 6 deletions test/torchaudio_unittest/backend/sox_io/smoke_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@

from parameterized import parameterized
from torchaudio.backend import sox_io_backend
from torchaudio_unittest.common_utils import (
get_wav_data,
skipIfNoSox,
TempDirMixin,
TorchaudioTestCase,
)
from torchaudio_unittest.common_utils import get_wav_data, skipIfNoSox, TempDirMixin, TorchaudioTestCase

from .common import name_func

Expand Down
6 changes: 1 addition & 5 deletions test/torchaudio_unittest/common_utils/case_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@
import torch
import torchaudio
from torch.testing._internal.common_utils import TestCase as PytorchTestCase
from torchaudio._internal.module_utils import (
is_kaldi_available,
is_module_available,
is_sox_available,
)
from torchaudio._internal.module_utils import is_kaldi_available, is_module_available, is_sox_available

from .backend_utils import set_audio_backend

Expand Down
8 changes: 1 addition & 7 deletions test/torchaudio_unittest/datasets/cmuarctic_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
from pathlib import Path

from torchaudio.datasets import cmuarctic
from torchaudio_unittest.common_utils import (
get_whitenoise,
normalize_wav,
save_wav,
TempDirMixin,
TorchaudioTestCase,
)
from torchaudio_unittest.common_utils import get_whitenoise, normalize_wav, save_wav, TempDirMixin, TorchaudioTestCase


def get_mock_dataset(root_dir):
Expand Down
8 changes: 1 addition & 7 deletions test/torchaudio_unittest/datasets/commonvoice_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@

from torch import Tensor
from torchaudio.datasets import COMMONVOICE
from torchaudio_unittest.common_utils import (
get_whitenoise,
normalize_wav,
save_wav,
TempDirMixin,
TorchaudioTestCase,
)
from torchaudio_unittest.common_utils import get_whitenoise, normalize_wav, save_wav, TempDirMixin, TorchaudioTestCase

_ORIGINAL_EXT_AUDIO = COMMONVOICE._ext_audio
_SAMPLE_RATE = 48000
Expand Down
7 changes: 1 addition & 6 deletions test/torchaudio_unittest/datasets/dr_vctk_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@

import pytest
from torchaudio.datasets import dr_vctk
from torchaudio_unittest.common_utils import (
get_whitenoise,
save_wav,
TempDirMixin,
TorchaudioTestCase,
)
from torchaudio_unittest.common_utils import get_whitenoise, save_wav, TempDirMixin, TorchaudioTestCase


_SUBSETS = ["train", "test"]
Expand Down
7 changes: 1 addition & 6 deletions test/torchaudio_unittest/datasets/fluentcommands_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@
from pathlib import Path

from torchaudio.datasets import fluentcommands
from torchaudio_unittest.common_utils import (
get_whitenoise,
save_wav,
TempDirMixin,
TorchaudioTestCase,
)
from torchaudio_unittest.common_utils import get_whitenoise, save_wav, TempDirMixin, TorchaudioTestCase

HEADER = ["", "path", "speakerId", "transcription", "action", "object", "location"]
SLOTS = ["action", "object", "location"]
Expand Down
8 changes: 1 addition & 7 deletions test/torchaudio_unittest/datasets/gtzan_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
from pathlib import Path

from torchaudio.datasets import gtzan
from torchaudio_unittest.common_utils import (
get_whitenoise,
normalize_wav,
save_wav,
TempDirMixin,
TorchaudioTestCase,
)
from torchaudio_unittest.common_utils import get_whitenoise, normalize_wav, save_wav, TempDirMixin, TorchaudioTestCase


def get_mock_dataset(root_dir):
Expand Down
7 changes: 1 addition & 6 deletions test/torchaudio_unittest/datasets/librilightlimited_test.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import os

from torchaudio.datasets import librilight_limited
from torchaudio_unittest.common_utils import (
get_whitenoise,
save_wav,
TempDirMixin,
TorchaudioTestCase,
)
from torchaudio_unittest.common_utils import get_whitenoise, save_wav, TempDirMixin, TorchaudioTestCase


# Used to generate a unique transcript for each dummy audio file
Expand Down
7 changes: 1 addition & 6 deletions test/torchaudio_unittest/datasets/librispeech_test_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,7 @@
from pathlib import Path

from torchaudio.datasets import librispeech
from torchaudio_unittest.common_utils import (
get_whitenoise,
normalize_wav,
save_wav,
TempDirMixin,
)
from torchaudio_unittest.common_utils import get_whitenoise, normalize_wav, save_wav, TempDirMixin

# Used to generate a unique transcript for each dummy audio file
_NUMBERS = ["ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT", "NINE"]
Expand Down
8 changes: 1 addition & 7 deletions test/torchaudio_unittest/datasets/libritts_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
from pathlib import Path

from torchaudio.datasets.libritts import LIBRITTS
from torchaudio_unittest.common_utils import (
get_whitenoise,
normalize_wav,
save_wav,
TempDirMixin,
TorchaudioTestCase,
)
from torchaudio_unittest.common_utils import get_whitenoise, normalize_wav, save_wav, TempDirMixin, TorchaudioTestCase

_UTTERANCE_IDS = [
[19, 198, "000000", "000000"],
Expand Down
8 changes: 1 addition & 7 deletions test/torchaudio_unittest/datasets/ljspeech_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
from pathlib import Path

from torchaudio.datasets import ljspeech
from torchaudio_unittest.common_utils import (
get_whitenoise,
normalize_wav,
save_wav,
TempDirMixin,
TorchaudioTestCase,
)
from torchaudio_unittest.common_utils import get_whitenoise, normalize_wav, save_wav, TempDirMixin, TorchaudioTestCase

_TRANSCRIPTS = [
"Test transcript 1",
Expand Down
7 changes: 1 addition & 6 deletions test/torchaudio_unittest/datasets/musdb_hq_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@
from parameterized import parameterized
from torchaudio.datasets import musdb_hq
from torchaudio.datasets.musdb_hq import _VALIDATION_SET
from torchaudio_unittest.common_utils import (
get_whitenoise,
save_wav,
TempDirMixin,
TorchaudioTestCase,
)
from torchaudio_unittest.common_utils import get_whitenoise, save_wav, TempDirMixin, TorchaudioTestCase

_SOURCE_SETS = [
(None,),
Expand Down
7 changes: 1 addition & 6 deletions test/torchaudio_unittest/datasets/quesst14_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@

from parameterized import parameterized
from torchaudio.datasets import quesst14
from torchaudio_unittest.common_utils import (
get_whitenoise,
save_wav,
TempDirMixin,
TorchaudioTestCase,
)
from torchaudio_unittest.common_utils import get_whitenoise, save_wav, TempDirMixin, TorchaudioTestCase


def _get_filename(folder, index):
Expand Down
8 changes: 1 addition & 7 deletions test/torchaudio_unittest/datasets/speechcommands_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
from pathlib import Path

from torchaudio.datasets import speechcommands
from torchaudio_unittest.common_utils import (
get_whitenoise,
normalize_wav,
save_wav,
TempDirMixin,
TorchaudioTestCase,
)
from torchaudio_unittest.common_utils import get_whitenoise, normalize_wav, save_wav, TempDirMixin, TorchaudioTestCase

_LABELS = [
"bed",
Expand Down
8 changes: 1 addition & 7 deletions test/torchaudio_unittest/datasets/tedlium_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@
from pathlib import Path

from torchaudio.datasets import tedlium
from torchaudio_unittest.common_utils import (
get_whitenoise,
save_wav,
skipIfNoSox,
TempDirMixin,
TorchaudioTestCase,
)
from torchaudio_unittest.common_utils import get_whitenoise, save_wav, skipIfNoSox, TempDirMixin, TorchaudioTestCase

# Used to generate a unique utterance for each dummy audio file
_UTTERANCES = [
Expand Down
8 changes: 1 addition & 7 deletions test/torchaudio_unittest/datasets/vctk_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
from pathlib import Path

from torchaudio.datasets import vctk
from torchaudio_unittest.common_utils import (
get_whitenoise,
normalize_wav,
save_wav,
TempDirMixin,
TorchaudioTestCase,
)
from torchaudio_unittest.common_utils import get_whitenoise, normalize_wav, save_wav, TempDirMixin, TorchaudioTestCase

# Used to generate a unique transcript for each dummy audio file
_TRANSCRIPT = [
Expand Down
8 changes: 1 addition & 7 deletions test/torchaudio_unittest/datasets/yesno_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,7 @@
from pathlib import Path

from torchaudio.datasets import yesno
from torchaudio_unittest.common_utils import (
get_whitenoise,
normalize_wav,
save_wav,
TempDirMixin,
TorchaudioTestCase,
)
from torchaudio_unittest.common_utils import get_whitenoise, normalize_wav, save_wav, TempDirMixin, TorchaudioTestCase


def get_mock_data(root_dir, labels):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
import os

from source_separation.utils.dataset import wsj0mix
from torchaudio_unittest.common_utils import (
get_whitenoise,
normalize_wav,
save_wav,
TempDirMixin,
TorchaudioTestCase,
)
from torchaudio_unittest.common_utils import get_whitenoise, normalize_wav, save_wav, TempDirMixin, TorchaudioTestCase


_FILENAMES = [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import torch
from torchaudio_unittest.common_utils import PytorchTestCase

from .tacotron2_loss_impl import (
Tacotron2LossGradcheckTests,
Tacotron2LossShapeTests,
Tacotron2LossTorchscriptTests,
)
from .tacotron2_loss_impl import Tacotron2LossGradcheckTests, Tacotron2LossShapeTests, Tacotron2LossTorchscriptTests


class TestTacotron2LossShapeFloat32CPU(Tacotron2LossShapeTests, PytorchTestCase):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import torch
from torchaudio_unittest.common_utils import PytorchTestCase, skipIfNoCuda

from .tacotron2_loss_impl import (
Tacotron2LossGradcheckTests,
Tacotron2LossShapeTests,
Tacotron2LossTorchscriptTests,
)
from .tacotron2_loss_impl import Tacotron2LossGradcheckTests, Tacotron2LossShapeTests, Tacotron2LossTorchscriptTests


@skipIfNoCuda
Expand Down
Loading

0 comments on commit fee994c

Please sign in to comment.