flake8 changes
This commit is contained in:
parent
670b70938a
commit
babe5776ce
|
|
@ -1,6 +1,5 @@
|
|||
import glob
|
||||
import os
|
||||
from re import S
|
||||
import numpy as np
|
||||
from scipy.io import wavfile
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,8 @@ class Avergeloss(nn.Module):
|
|||
def validate_loss(self, loss: str):
|
||||
if loss not in LOSS_MAP.keys():
|
||||
raise ValueError(
|
||||
f"Invalid loss function {loss}, available loss functions are {tuple([loss for loss in LOSS_MAP.keys()])}"
|
||||
f"""Invalid loss function {loss}, available loss functions are
|
||||
{tuple([loss for loss in LOSS_MAP.keys()])}"""
|
||||
)
|
||||
else:
|
||||
return LOSS_MAP[loss]
|
||||
|
|
|
|||
|
|
@ -1,16 +1,10 @@
|
|||
try:
|
||||
from functools import cached_property
|
||||
except ImportError:
|
||||
from backports.cached_property import cached_property
|
||||
from importlib import import_module
|
||||
from huggingface_hub import cached_download, hf_hub_url
|
||||
import logging
|
||||
import numpy as np
|
||||
import os
|
||||
from typing import Optional, Union, List, Text, Dict, Any
|
||||
from torch.optim import Adam
|
||||
import torch
|
||||
from torch.nn.functional import pad
|
||||
import pytorch_lightning as pl
|
||||
from pytorch_lightning.utilities.cloud_io import load as pl_load
|
||||
from urllib.parse import urlparse
|
||||
|
|
@ -19,7 +13,6 @@ from pathlib import Path
|
|||
|
||||
from enhancer import __version__
|
||||
from enhancer.data.dataset import EnhancerDataset
|
||||
from enhancer.utils.io import Audio
|
||||
from enhancer.loss import Avergeloss
|
||||
from enhancer.inference import Inference
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ def check_files(root_dir: str, files: Files):
|
|||
|
||||
|
||||
def merge_dict(default_dict: dict, custom: Optional[dict] = None):
|
||||
|
||||
params = dict(default_dict)
|
||||
if custom:
|
||||
params.update(custom)
|
||||
|
|
|
|||
Loading…
Reference in New Issue