unit test modelscope for sd
| | |
| | | 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 = { |
| | |
| | | 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 |
| | |
| | | dur_threshold: int = 10, |
| | | out_format: str = "vad", |
| | | param_dict: Optional[dict] = None, |
| | | mode: str = "sond", |
| | | **kwargs, |
| | | ): |
| | | assert check_argument_types() |
| | |
| | | set_all_random_seed(seed) |
| | | |
| | | # 2a. Build speech2xvec [Optional] |
| | | if param_dict is not None and "extract_profile" in param_dict and param_dict["extract_profile"]: |
| | | if mode == "sond_demo" and param_dict is not None and "extract_profile" in param_dict and param_dict["extract_profile"]: |
| | | assert "sv_train_config" in param_dict, "sv_train_config must be provided param_dict." |
| | | assert "sv_model_file" in param_dict, "sv_model_file must be provided in param_dict." |
| | | sv_train_config = param_dict["sv_train_config"] |