From 8613aac482b504b185429e980842af61cf27c272 Mon Sep 17 00:00:00 2001 From: Yong Yue Date: Fri, 24 Jul 2026 16:15:38 +0800 Subject: [PATCH] recipe(wav2vec2): add jonatasgrosman/wav2vec2-large-xlsr-53-polish ASR recipes Add CPU fp32 and fp16 recipes for this Wav2Vec2ForCTC Polish ASR model. The recipe forces model_class=AutoModelForCTC to work around the default AutoModelForSpeechSeq2Seq loader which rejects Wav2Vec2Config. --- ...omatic-speech-recognition_fp16_config.json | 53 +++++++++++++++++++ ...omatic-speech-recognition_fp32_config.json | 34 ++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 examples/recipes/jonatasgrosman_wav2vec2-large-xlsr-53-polish/cpu/cpu/automatic-speech-recognition_fp16_config.json create mode 100644 examples/recipes/jonatasgrosman_wav2vec2-large-xlsr-53-polish/cpu/cpu/automatic-speech-recognition_fp32_config.json diff --git a/examples/recipes/jonatasgrosman_wav2vec2-large-xlsr-53-polish/cpu/cpu/automatic-speech-recognition_fp16_config.json b/examples/recipes/jonatasgrosman_wav2vec2-large-xlsr-53-polish/cpu/cpu/automatic-speech-recognition_fp16_config.json new file mode 100644 index 000000000..a49f5fbfb --- /dev/null +++ b/examples/recipes/jonatasgrosman_wav2vec2-large-xlsr-53-polish/cpu/cpu/automatic-speech-recognition_fp16_config.json @@ -0,0 +1,53 @@ +{ + "export": { + "opset_version": 17, + "batch_size": 1, + "export_params": true, + "do_constant_folding": true, + "verbose": false, + "dynamo": false, + "enable_hierarchy_tags": true, + "clean_onnx": false, + "hierarchy_tag_format": "full", + "input_tensors": [ + { + "name": "input_values", + "dtype": "float32", + "shape": [1, 16000], + "value_range": [-1, 1] + } + ], + "output_tensors": [ + { + "name": "logits" + } + ] + }, + "optim": {}, + "quant": { + "mode": "fp16", + "samples": 10, + "calibration_method": "minmax", + "weight_type": "uint8", + "activation_type": "uint8", + "per_channel": false, + "symmetric": false, + "weight_symmetric": null, + "activation_symmetric": null, + "save_calibration": false, + "distribution": "uniform", + "seed": null, + "calibration_load_path": null, + "calibration_save_path": null, + "op_types_to_quantize": null, + "nodes_to_exclude": null, + "fp16_keep_io_types": true, + "fp16_op_block_list": null + }, + "compile": null, + "loader": { + "task": "automatic-speech-recognition", + "model_class": "AutoModelForCTC", + "model_type": "wav2vec2" + } +} diff --git a/examples/recipes/jonatasgrosman_wav2vec2-large-xlsr-53-polish/cpu/cpu/automatic-speech-recognition_fp32_config.json b/examples/recipes/jonatasgrosman_wav2vec2-large-xlsr-53-polish/cpu/cpu/automatic-speech-recognition_fp32_config.json new file mode 100644 index 000000000..66380c538 --- /dev/null +++ b/examples/recipes/jonatasgrosman_wav2vec2-large-xlsr-53-polish/cpu/cpu/automatic-speech-recognition_fp32_config.json @@ -0,0 +1,34 @@ +{ + "export": { + "opset_version": 17, + "batch_size": 1, + "export_params": true, + "do_constant_folding": true, + "verbose": false, + "dynamo": false, + "enable_hierarchy_tags": true, + "clean_onnx": false, + "hierarchy_tag_format": "full", + "input_tensors": [ + { + "name": "input_values", + "dtype": "float32", + "shape": [1, 16000], + "value_range": [-1, 1] + } + ], + "output_tensors": [ + { + "name": "logits" + } + ] + }, + "optim": {}, + "quant": null, + "compile": null, + "loader": { + "task": "automatic-speech-recognition", + "model_class": "AutoModelForCTC", + "model_type": "wav2vec2" + } +}