This commit is contained in:
游雁 2024-07-17 10:16:19 +08:00
parent 374998bd36
commit a836eca98e
2 changed files with 20 additions and 0 deletions

View File

@ -156,6 +156,16 @@ res = model.generate(
text = rich_transcription_postprocess(res[0]["text"])
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).
- `merge_vad`: Whether to concatenate short audio fragments cut by the vad model, with the merged length being `merge_length_s`, measured in seconds (s).
#### Paraformer
```python
from funasr import AutoModel

View File

@ -155,6 +155,16 @@ res = model.generate(
text = rich_transcription_postprocess(res[0]["text"])
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` 表示采用动态batchbatch中总音频时长单位为秒s。
- `merge_vad`:是否将 vad 模型切割的短音频碎片合成,合并后长度为`merge_length_s`单位为秒s。
#### Paraformer
```python
from funasr import AutoModel