wenet icon indicating copy to clipboard operation
wenet copied to clipboard

Auto-generated encoder model config

Open yzmyyff opened this issue 3 years ago • 6 comments

resolve #902

yzmyyff avatar Jan 18 '22 08:01 yzmyyff

@Slyne , please review.

robin1001 avatar Jan 18 '22 08:01 robin1001

I think I don't get your point.

Tritonserver supports Auto-Generated Model Configuration. So I just remove the output in the template.

Do you mean that we must define output shape explicitly?

yzmyyff avatar Jan 18 '22 09:01 yzmyyff

I think I don't get your point.

Tritonserver supports Auto-Generated Model Configuration. So I just remove the output in the template.

Do you mean that we must define output shape explicitly?

It's not a must. But it will be easier for users to debug. For example, the wenetspeech offline model exported by onnx has an encoder of shape [B, T, -1], while for aishell2 u2++ model , the output shape is [B, T, 256]. After we generate the onnx model, users may encounter some issues in server part and if the config.pbtxt can provide more info, it will be more helpful.

Slyne avatar Jan 18 '22 09:01 Slyne

Why not use HTTP API?

curl localhost:8000/v2/models/<model name>/config

Then we can completely avoid processing the model details.

yzmyyff avatar Jan 18 '22 09:01 yzmyyff

Why not use HTTP API?

curl localhost:8000/v2/models/<model name>/config

Then we can completely avoid processing the model details.

This suggestion is great! We may call other model's configuration instead of reading onnx_config.json in triton. For example, the feature_size in this line can be inferred from encoder_out tensor from encoder model. However, it's still due to the previous issue I mentioned, this feature size might be '-1', and it will fail from this line.

I'm working on updating this example to the latest triton, 22.01. The issue you mentioned will also be fixed. But I will fix this issue by reading the generated onnx model. I still believe a config file with full details will be better.

Slyne avatar Jan 18 '22 10:01 Slyne

Great!

This PR can be closed If you're working on that.

yzmyyff avatar Jan 19 '22 01:01 yzmyyff