Commit 45d273d
📚 docs(granite-speech): add comprehensive usage examples (#42125)
* 📚 docs(granite-speech): add comprehensive usage examples
Resolves the TODO (@alex-jw-brooks) by adding complete usage documentation
for Granite Speech model now that it's released and compatible with transformers.
Added examples for:
- Basic speech transcription
- Speech-to-text with additional context
- Batch processing multiple audio files
- Tips for best results (audio format, LoRA adapter, memory optimization)
This helps users get started with the Granite Speech multimodal model
by providing practical, copy-paste-ready code examples for common use cases.
Replaces TODO comment on line 44 with ~100 lines of comprehensive
documentation following the patterns used in other multimodal model docs.
* Address review feedback: add chat template usage and move model-specific tips
- Added proper chat template formatting in the second example (per @zucchini-nlp feedback)
- Removed generic LLM tips (temperature, batch size, memory)
- Moved Granite Speech-specific tips (audio format, LoRA adapter) to Usage tips section
This keeps the documentation focused on model-specific features rather than general LLM knowledge.
* docs: use datasets library for working audio examples
Address review feedback by replacing placeholder audio paths with real
examples using hf-internal-testing/librispeech_asr_dummy dataset. This
makes all code examples copy-paste ready and reproducible.
- Add datasets import to all three examples
- Replace 'path/to/audio.wav' with actual dataset loading
- Ensure proper audio sampling rate handling
Co-authored-by: eustlb <[email protected]>
* 📚 docs: use modern chat template pattern with tokenize=True for audio
---------
Co-authored-by: eustlb <[email protected]>1 parent 672dc07 commit 45d273d
1 file changed
+108
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
43 | 151 | | |
44 | | - | |
45 | 152 | | |
46 | 153 | | |
47 | 154 | | |
| |||
0 commit comments