Incorrect handling of export config parameters
- Dominant language
- Python
- Stars
- 169
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I noticed an issue when converting a Transducer model from espnet to espnet_onnx where the ```max_seq_len``` in the ```DefaultEncoder``` class was not properly set when specifying ```m.set_export_config(max_seq_len=5000)``` in top-level export script.
To me it looks like the issue is caused by incorrectly passing the ```export_config``` to the ```replace_modules``` method in ```get_encoder``` method here:
```
$ git diff espnet_onnx/export/asr/models/__init__.py
diff --git a/espnet_onnx/export/asr/models/__init__.py b/espnet_onnx/export/asr/models/__init__.py
index d40de3f..7db3bbb 100644
--- a/espnet_onnx/export/asr/models/__init__.py
+++ b/espnet_onnx/export/asr/models/__init__.py
@@ -56,7 +56,7 @@ def get_encoder(model, frontend, preencoder, export_config, convert_map):
),
model,
preencoder=preencoder,
- export_config=export_config,
+ **export_config,
)
return DefaultEncoder(_model, frontend, **export_config)
```
For instance, with current code ```OnnxRelPositionalEncoding``` was always initialized with default value of 512 instead of what was specified in ```export_config``` dict.
@Masao-Someki: Could you please take a look and let me know if that change looks correct?
Thanks!
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.