Update README.md
Browse files
README.md
CHANGED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
pipeline_tag: audio-text-to-text
|
| 5 |
+
tags:
|
| 6 |
+
- audio
|
| 7 |
+
- speech
|
| 8 |
+
- voice-assistant
|
| 9 |
+
- voicebench
|
| 10 |
+
- gemma
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+

|
| 15 |
+
|
| 16 |
+
LFG-3 is an audio-language model that fuses the intelligence of Gemma 4 31B with a Parakeet audio encoder through a trained projection later. Speech goes in, text comes out.
|
| 17 |
+
|
| 18 |
+
The model is the third iteration in a personal learning journey to asnwer the question, "Can I stand on the sholders of giants and use limited compute resourcs to a standout model that can understand what and how you say things, not just speech to text."
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
## Voice Bench Results
|
| 22 |
+
| Subset |Metric | Score |
|
| 23 |
+
| --- | --- | ---: |
|
| 24 |
+
| AlpacaEval | (1-5, GPT) | 4.73 |
|
| 25 |
+
| CommonEval | (1-5, GPT) | 4.40 |
|
| 26 |
+
| WildVoice | (1-5, GPT) | 4.45 |
|
| 27 |
+
| SD-QA | (% GPT majority) | 78.12 |
|
| 28 |
+
| MMSU | (% accuracy) | 85.52 8 |
|
| 29 |
+
| OpenBookQA | (% accuracy) | 94.73 |
|
| 30 |
+
| BBH | (% accuracy) | 92.20 |
|
| 31 |
+
| IFEval |(% strict-loose avg) | 88.54 |
|
| 32 |
+
|AdvBench | (% refusal rate) | 98.27 |
|
| 33 |
+
| Overall | (mean of 9) | 89.88 |
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
## Usage
|
| 38 |
+
|
| 39 |
+
```python
|
| 40 |
+
import soundfile as sf
|
| 41 |
+
from transformers import AutoModelForMultimodalLM, AutoProcessor
|
| 42 |
+
|
| 43 |
+
MODEL = "glenn2/LFG-3-p8-2000"
|
| 44 |
+
processor = AutoProcessor.from_pretrained(MODEL, trust_remote_code=True)
|
| 45 |
+
model = AutoModelForMultimodalLM.from_pretrained(
|
| 46 |
+
MODEL, trust_remote_code=True, dtype="bfloat16", device_map="cuda"
|
| 47 |
+
)
|
| 48 |
+
audio, sr = sf.read("question.wav") # 16 kHz mono
|
| 49 |
+
|
| 50 |
+
|
| 51 |
+
messages = [
|
| 52 |
+
{"role": "system", "content": [{"type": "text", "text": "You are a helpful voice assistant. The user is speaking to you, and your reply will be read aloud."}]},
|
| 53 |
+
{"role": "user", "content": [{"type": "audio", "audio": audio}]}, # Audio should be 16 kHz mono.
|
| 54 |
+
]
|
| 55 |
+
# Process input
|
| 56 |
+
inputs = processor.apply_chat_template(
|
| 57 |
+
messages,
|
| 58 |
+
tokenize=True,
|
| 59 |
+
return_dict=True,
|
| 60 |
+
return_tensors="pt",
|
| 61 |
+
add_generation_prompt=True,
|
| 62 |
+
enable_thinking=True
|
| 63 |
+
).to(model.device)
|
| 64 |
+
input_len = inputs["input_ids"].shape[-1]
|
| 65 |
+
|
| 66 |
+
# Generate output
|
| 67 |
+
outputs = model.generate(**inputs, max_new_tokens=4096)
|
| 68 |
+
response = processor.decode(outputs[0][input_len:], skip_special_tokens=False)
|
| 69 |
+
|
| 70 |
+
# Parse output
|
| 71 |
+
print(processor.parse_response(response)["content"])
|
| 72 |
+
```
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
## Intended use
|
| 76 |
+
|
| 77 |
+
- Designed for **English** spoken questions/instructions → text answers.
|
| 78 |
+
- Inherits knowledge from the Gemma 4 31B IT model.
|