|
|
|
@@ -7,7 +7,6 @@ import scipy.io.wavfile as wav |
|
|
|
import torch |
|
|
|
import yaml |
|
|
|
|
|
|
|
from modelscope.fileio import File |
|
|
|
from modelscope.metainfo import Pipelines |
|
|
|
from modelscope.outputs import OutputKeys |
|
|
|
from modelscope.pipelines.base import Pipeline |
|
|
|
@@ -22,9 +21,6 @@ FEATURE_MVN = 'feature.DEY.mvn.txt' |
|
|
|
|
|
|
|
CONFIG_YAML = 'dey_mini.yaml' |
|
|
|
|
|
|
|
AEC_LIB_URL = 'https://modelscope.oss-cn-beijing.aliyuncs.com/dependencies/ics_MaaS_AEC_lib_libmitaec_pyio.so' |
|
|
|
AEC_LIB_FILE = 'libmitaec_pyio.so' |
|
|
|
|
|
|
|
|
|
|
|
def initialize_config(module_cfg): |
|
|
|
r"""According to config items, load specific module dynamically with params. |
|
|
|
@@ -70,12 +66,6 @@ class LinearAECPipeline(Pipeline): |
|
|
|
""" |
|
|
|
super().__init__(model=model, **kwargs) |
|
|
|
|
|
|
|
# auto download so for linux inference before light-weight docker got ready |
|
|
|
if not os.path.exists(AEC_LIB_FILE): |
|
|
|
logger.info(f'downloading {AEC_LIB_URL} to {AEC_LIB_FILE}') |
|
|
|
with open(AEC_LIB_FILE, 'wb') as ofile: |
|
|
|
ofile.write(File.read(AEC_LIB_URL)) |
|
|
|
|
|
|
|
self.use_cuda = torch.cuda.is_available() |
|
|
|
with open( |
|
|
|
os.path.join(self.model, CONFIG_YAML), encoding='utf-8') as f: |
|
|
|
|