Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
1 change: 1 addition & 0 deletions examples/models/parakeet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ From the executorch root directory:
| `--audio_path` | Path to input audio file (.wav) |
| `--tokenizer_path` | Path to tokenizer file (default: `tokenizer.json`) |
| `--data_path` | Path to data file (.ptd) for delegate data (optional, required for CUDA) |
| `--timestamps` | Timestamp output mode: none\|subword\|word\|segment\|all (requires `window_stride` + `encoder_subsampling_factor` in model metadata) |
4 changes: 4 additions & 0 deletions examples/models/parakeet/export_parakeet_tdt.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,17 @@ def export_all(model):
)

sample_rate = model.preprocessor._cfg.sample_rate
window_stride = float(model.preprocessor._cfg.window_stride)
encoder_subsampling_factor = int(getattr(model.encoder, "subsampling_factor", 8))
metadata = {
"num_rnn_layers": num_layers,
"pred_hidden": pred_hidden,
"joint_hidden": joint_hidden,
"vocab_size": model.tokenizer.vocab_size,
"blank_id": model.tokenizer.vocab_size,
"sample_rate": sample_rate,
"window_stride": window_stride,
"encoder_subsampling_factor": encoder_subsampling_factor,
}

return programs, metadata
Expand Down
Loading