From d9ada679b504568433c715d0dff60209d9160d1b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 30 Aug 2023 00:31:03 +0800 Subject: [PATCH] Format code (#1122) Co-authored-by: github-actions[bot] --- configs/config.py | 3 +++ infer-web.py | 3 +++ infer/modules/uvr5/mdxnet.py | 1 + 3 files changed, 7 insertions(+) diff --git a/configs/config.py b/configs/config.py index 116025a..6ca948e 100644 --- a/configs/config.py +++ b/configs/config.py @@ -23,14 +23,17 @@ def use_fp32_config(): with open("infer/modules/train/preprocess.py", "w") as f: f.write(strr) + def singleton_variable(func): def wrapper(*args, **kwargs): if not wrapper.instance: wrapper.instance = func(*args, **kwargs) return wrapper.instance + wrapper.instance = None return wrapper + @singleton_variable class Config: def __init__(self): diff --git a/infer-web.py b/infer-web.py index 20c3cbf..ac7ba51 100644 --- a/infer-web.py +++ b/infer-web.py @@ -157,10 +157,13 @@ def change_choices(): def clean(): return {"value": "", "__type__": "update"} + def export_onnx(): from infer.modules.onnx.export import export_onnx as eo + eo() + sr_dict = { "32k": 32000, "40k": 40000, diff --git a/infer/modules/uvr5/mdxnet.py b/infer/modules/uvr5/mdxnet.py index c21c989..b2918a8 100644 --- a/infer/modules/uvr5/mdxnet.py +++ b/infer/modules/uvr5/mdxnet.py @@ -87,6 +87,7 @@ def get_models(device, dim_f, dim_t, n_fft): class Predictor: def __init__(self, args): import onnxruntime as ort + print(ort.get_available_providers()) self.args = args self.model_ = get_models(