From ce8177a9322127219459f5c32e8b74b7a177df2c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 30 Aug 2023 19:03:21 +0800 Subject: [PATCH] Format code (#1136) Co-authored-by: github-actions[bot] --- configs/config.py | 2 +- infer-web.py | 3 ++- infer/lib/rmvpe.py | 5 +++-- infer/modules/vc/pipeline.py | 8 ++++++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/configs/config.py b/configs/config.py index ee120ee..ca78928 100644 --- a/configs/config.py +++ b/configs/config.py @@ -181,7 +181,7 @@ class Config: ) except: pass - #if self.device != "cpu": + # if self.device != "cpu": import torch_directml self.device = torch_directml.device(torch_directml.default_device()) diff --git a/infer-web.py b/infer-web.py index d2a0e93..6b96a04 100644 --- a/infer-web.py +++ b/infer-web.py @@ -1,4 +1,5 @@ -import os,sys +import os, sys + now_dir = os.getcwd() sys.path.append(now_dir) import logging diff --git a/infer/lib/rmvpe.py b/infer/lib/rmvpe.py index b18c896..c3605c4 100644 --- a/infer/lib/rmvpe.py +++ b/infer/lib/rmvpe.py @@ -1,4 +1,4 @@ -import pdb,os +import pdb, os import numpy as np import torch @@ -577,7 +577,8 @@ class RMVPE: import onnxruntime as ort ort_session = ort.InferenceSession( - "%s/rmvpe.onnx"%os.environ["rmvpe_root"], providers=["DmlExecutionProvider"] + "%s/rmvpe.onnx" % os.environ["rmvpe_root"], + providers=["DmlExecutionProvider"], ) self.model = ort_session else: diff --git a/infer/modules/vc/pipeline.py b/infer/modules/vc/pipeline.py index e239090..7036a0e 100644 --- a/infer/modules/vc/pipeline.py +++ b/infer/modules/vc/pipeline.py @@ -139,9 +139,13 @@ class Pipeline(object): if not hasattr(self, "model_rmvpe"): from infer.lib.rmvpe import RMVPE - print("loading rmvpe model,%s"%"%s/rmvpe.pt"%os.environ["rmvpe_root"]) + print( + "loading rmvpe model,%s" % "%s/rmvpe.pt" % os.environ["rmvpe_root"] + ) self.model_rmvpe = RMVPE( - "%s/rmvpe.pt"%os.environ["rmvpe_root"], is_half=self.is_half, device=self.device + "%s/rmvpe.pt" % os.environ["rmvpe_root"], + is_half=self.is_half, + device=self.device, ) f0 = self.model_rmvpe.infer_from_audio(x, thred=0.03)