Format code (#1122)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
parent
5f5ec4749c
commit
d9ada679b5
@ -23,14 +23,17 @@ def use_fp32_config():
|
|||||||
with open("infer/modules/train/preprocess.py", "w") as f:
|
with open("infer/modules/train/preprocess.py", "w") as f:
|
||||||
f.write(strr)
|
f.write(strr)
|
||||||
|
|
||||||
|
|
||||||
def singleton_variable(func):
|
def singleton_variable(func):
|
||||||
def wrapper(*args, **kwargs):
|
def wrapper(*args, **kwargs):
|
||||||
if not wrapper.instance:
|
if not wrapper.instance:
|
||||||
wrapper.instance = func(*args, **kwargs)
|
wrapper.instance = func(*args, **kwargs)
|
||||||
return wrapper.instance
|
return wrapper.instance
|
||||||
|
|
||||||
wrapper.instance = None
|
wrapper.instance = None
|
||||||
return wrapper
|
return wrapper
|
||||||
|
|
||||||
|
|
||||||
@singleton_variable
|
@singleton_variable
|
||||||
class Config:
|
class Config:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -157,10 +157,13 @@ def change_choices():
|
|||||||
def clean():
|
def clean():
|
||||||
return {"value": "", "__type__": "update"}
|
return {"value": "", "__type__": "update"}
|
||||||
|
|
||||||
|
|
||||||
def export_onnx():
|
def export_onnx():
|
||||||
from infer.modules.onnx.export import export_onnx as eo
|
from infer.modules.onnx.export import export_onnx as eo
|
||||||
|
|
||||||
eo()
|
eo()
|
||||||
|
|
||||||
|
|
||||||
sr_dict = {
|
sr_dict = {
|
||||||
"32k": 32000,
|
"32k": 32000,
|
||||||
"40k": 40000,
|
"40k": 40000,
|
||||||
|
@ -87,6 +87,7 @@ def get_models(device, dim_f, dim_t, n_fft):
|
|||||||
class Predictor:
|
class Predictor:
|
||||||
def __init__(self, args):
|
def __init__(self, args):
|
||||||
import onnxruntime as ort
|
import onnxruntime as ort
|
||||||
|
|
||||||
print(ort.get_available_providers())
|
print(ort.get_available_providers())
|
||||||
self.args = args
|
self.args = args
|
||||||
self.model_ = get_models(
|
self.model_ = get_models(
|
||||||
|
Loading…
Reference in New Issue
Block a user