diff --git a/README.md b/README.md index 1164fb1..63b74a3 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,8 @@ model_dir = "iic/SenseVoiceSmall" model = AutoModel( model=model_dir, + trust_remote_code=True, + remote_code="./model.py", vad_model="fsmn-vad", vad_kwargs={"max_single_segment_time": 30000}, device="cpu", @@ -127,6 +129,9 @@ print(text) Parameter Descriptions: - `model_dir`: The name of the model, or the model's path on the local disk. +- `trust_remote_code`: + - When set to `True`, this indicates that the model's code implementation should be loaded from the location specified by `remote_code`, which points to the exact code for the model (for example, `model.py` in the current directory). It supports absolute paths, relative paths, and network URLs. + - When set to `False`, this signifies that the model's code implementation is the integrated version within [FunASR](https://github.com/modelscope/FunASR). In this case, any modifications to `model.py` in the current directory will not take effect because the version loaded is the internal one from FunASR. For the model code, [click here to view](https://github.com/modelscope/FunASR/tree/main/funasr/models/sense_voice). - `max_single_segment_time`: The maximum length of audio segments that the `vad_model` can cut, measured in milliseconds (ms). - `use_itn`: Indicates whether the output should include punctuation and inverse text normalization. - `batch_size_s`: Represents a dynamic batch size where the total duration of the audio in the batch is measured in seconds (s). diff --git a/README_zh.md b/README_zh.md index 7cadf84..06ade99 100644 --- a/README_zh.md +++ b/README_zh.md @@ -132,6 +132,9 @@ print(text) ``` 参数说明: - `model_dir`:模型名称,或本地磁盘中的模型路径。 +- `trust_remote_code`: + - `True`表示model代码实现从`remote_code`处加载,`remote_code`指定`model`具体代码的位置(例如,当前目录下的`model.py`),支持绝对路径与相对路径,以及网络url。 + - `False`表示,model代码实现为 [FunASR](https://github.com/modelscope/FunASR) 内部集成版本,此时修改当前目录下的`model.py`不会生效,因为加载的是funasr内部版本,模型代码[点击查看](https://github.com/modelscope/FunASR/tree/main/funasr/models/sense_voice)。 - `max_single_segment_time`: 表示`vad_model`最大切割音频时长, 单位是毫秒ms。 - `use_itn`:输出结果中是否包含标点与逆文本正则化。 - `batch_size_s` 表示采用动态batch,batch中总音频时长,单位为秒s。