游雁
2024-10-16 790043364026835b0d834b165b1a65f7323cb6f1
docs/tutorial/README_zh.md
@@ -7,6 +7,7 @@
 <a href="#模型推理"> 模型推理 </a>   
|<a href="#模型训练与测试"> 模型训练与测试 </a>
|<a href="#模型导出与测试"> 模型导出与测试 </a>
|<a href="#新模型注册教程"> 新模型注册教程 </a>
</h4>
</div>
@@ -359,7 +360,7 @@
#### 有configuration.json
假定,训练模型路径为:./model_dir,如果改目录下有生成configuration.json,只需要将 [上述模型推理方法](https://github.com/alibaba-damo-academy/FunASR/blob/main/examples/README_zh.md#%E6%A8%A1%E5%9E%8B%E6%8E%A8%E7%90%86) 中模型名字修改为模型路径即可
假定,训练模型路径为:./model_dir,如果该目录下有生成configuration.json,只需要将 [上述模型推理方法](https://github.com/alibaba-damo-academy/FunASR/blob/main/examples/README_zh.md#%E6%A8%A1%E5%9E%8B%E6%8E%A8%E7%90%86) 中模型名字修改为模型路径即可
例如:
@@ -433,4 +434,58 @@
print(result)
```
更多例子请参考 [样例](https://github.com/alibaba-damo-academy/FunASR/tree/main/runtime/python/onnxruntime)
更多例子请参考 [样例](https://github.com/alibaba-damo-academy/FunASR/tree/main/runtime/python/onnxruntime)
<a name="新模型注册教程"></a>
## 新模型注册教程
### 查看注册表
```python
from funasr.register import tables
tables.print()
```
支持查看指定类型的注册表:`tables.print("model")`
### 注册新模型
```python
from funasr.register import tables
@tables.register("model_classes", "MinMo_S2T")
class MinMo_S2T(nn.Module):
  def __init__(*args, **kwargs):
    ...
  def forward(
      self,
      **kwargs,
  ):
  def inference(
      self,
      data_in,
      data_lengths=None,
      key: list = None,
      tokenizer=None,
      frontend=None,
      **kwargs,
  ):
    ...
```
然后在config.yaml中指定新注册模型
```yaml
model: MinMo_S2T
model_conf:
  ...
```
[更多详细教程文档](https://github.com/alibaba-damo-academy/FunASR/docs/tutorial/Tables_zh.md)