Instructions to use Reson8/Rumble-2-Flash with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Reson8/Rumble-2-Flash with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("automatic-speech-recognition", model="Reson8/Rumble-2-Flash")# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Reson8/Rumble-2-Flash") model = AutoModelForMultimodalLM.from_pretrained("Reson8/Rumble-2-Flash", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Simplify Transformers usage snippet
#2
by eustlb HF Staff - opened
README.md
CHANGED
|
@@ -64,33 +64,27 @@ Speech recognition model with native Hugging Face Transformers and vLLM support.
|
|
| 64 |
## Usage (Transformers)
|
| 65 |
|
| 66 |
```bash
|
| 67 |
-
uv pip install torch
|
| 68 |
```
|
| 69 |
|
| 70 |
```python
|
| 71 |
-
import
|
| 72 |
-
import torch
|
| 73 |
-
from transformers import AutoProcessor, Qwen3ASRForConditionalGeneration
|
| 74 |
|
| 75 |
model_id = "Reson8/Rumble-2-Flash"
|
| 76 |
processor = AutoProcessor.from_pretrained(model_id)
|
| 77 |
-
model =
|
| 78 |
-
model_id, dtype=torch.bfloat16
|
| 79 |
-
).to("cuda")
|
| 80 |
|
| 81 |
-
audio, _ = librosa.load("audio.wav", sr=16000)
|
| 82 |
inputs = processor.apply_transcription_request(
|
| 83 |
-
audio=audio
|
|
|
|
| 84 |
).to(model.device, dtype=model.dtype)
|
| 85 |
|
| 86 |
-
|
| 87 |
-
output = model.generate(**inputs, max_new_tokens=512)
|
| 88 |
-
|
| 89 |
generated = output[:, inputs["input_ids"].shape[-1]:]
|
| 90 |
-
print(processor.
|
| 91 |
```
|
| 92 |
|
| 93 |
-
|
| 94 |
|
| 95 |
## Usage (vLLM)
|
| 96 |
|
|
|
|
| 64 |
## Usage (Transformers)
|
| 65 |
|
| 66 |
```bash
|
| 67 |
+
uv pip install torch transformers accelerate
|
| 68 |
```
|
| 69 |
|
| 70 |
```python
|
| 71 |
+
from transformers import AutoProcessor, AutoModelForMultimodalLM
|
|
|
|
|
|
|
| 72 |
|
| 73 |
model_id = "Reson8/Rumble-2-Flash"
|
| 74 |
processor = AutoProcessor.from_pretrained(model_id)
|
| 75 |
+
model = AutoModelForMultimodalLM.from_pretrained(model_id, device_map="auto")
|
|
|
|
|
|
|
| 76 |
|
|
|
|
| 77 |
inputs = processor.apply_transcription_request(
|
| 78 |
+
audio="https://hf.co/datasets/hf-internal-testing/dummy-audio-samples/resolve/main/bcn_weather.mp3",
|
| 79 |
+
language="English", # omit to detect automatically
|
| 80 |
).to(model.device, dtype=model.dtype)
|
| 81 |
|
| 82 |
+
output = model.generate(**inputs, max_new_tokens=512)
|
|
|
|
|
|
|
| 83 |
generated = output[:, inputs["input_ids"].shape[-1]:]
|
| 84 |
+
print(processor.decode(generated, return_format="transcription_only")[0]) # return_format="parsed" if detecting language
|
| 85 |
```
|
| 86 |
|
| 87 |
+
`audio` accepts a local path, a URL, a NumPy array, or a list of these.
|
| 88 |
|
| 89 |
## Usage (vLLM)
|
| 90 |
|