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:
|
||||
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):
|
||||
|
@ -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,
|
||||
|
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user