1
0
mirror of synced 2024-11-12 01:40:51 +01:00

Format code (#1122)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot] 2023-08-30 00:31:03 +08:00 committed by GitHub
parent 5f5ec4749c
commit d9ada679b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 0 deletions

View File

@ -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):

View File

@ -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,

View File

@ -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(