| | |
| | | def inference_launch(mode, **kwargs): |
| | | if mode == "sond": |
| | | from funasr.bin.sond_inference import inference_modelscope |
| | | return inference_modelscope(**kwargs) |
| | | return inference_modelscope(mode=mode, **kwargs) |
| | | elif mode == "sond_demo": |
| | | from funasr.bin.sond_inference import inference_modelscope |
| | | param_dict = { |
| | |
| | | "sv_train_config": "sv.yaml", |
| | | "sv_model_file": "sv.pth", |
| | | } |
| | | if "param_dict" in kwargs: |
| | | kwargs["param_dict"].update(param_dict) |
| | | if "param_dict" in kwargs and kwargs["param_dict"] is not None: |
| | | for key in param_dict: |
| | | if key not in kwargs["param_dict"]: |
| | | kwargs["param_dict"][key] = param_dict[key] |
| | | else: |
| | | kwargs["param_dict"] = param_dict |
| | | return inference_modelscope(**kwargs) |
| | | return inference_modelscope(mode=mode, **kwargs) |
| | | else: |
| | | logging.info("Unknown decoding mode: {}".format(mode)) |
| | | return None |