Audio Classification
Transformers
Safetensors
English
tone_cnn
feature-extraction
speech-commands
cnn
audio
custom_code
Eval Results (legacy)
Instructions to use harpertoken/tone with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use harpertoken/tone with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("audio-classification", model="harpertoken/tone", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("harpertoken/tone", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -48,6 +48,12 @@ print(model.predict_label(waveform))
|
|
| 48 |
|
| 49 |
`predict_label` takes 16,000 float samples at 16 kHz and returns the command word. Clips shorter than a second are zero-padded and longer ones truncated, matching training exactly. Needs `torch`, `torchaudio` for the mel transform, and `transformers`.
|
| 50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
## Training
|
| 52 |
|
| 53 |
Canonical Speech Commands v0.02 via torchaudio, restricted to the ten command words (34,472 train clips after the test split is removed, 4,074 test). Torchaudio's own loader needed torchcodec, whose native library would not load on the training machine, so waveforms were read with scipy and the mel transform uses torchaudio's pure-torch `MelSpectrogram`. An earlier hand-rolled mel filterbank trained to chance (loss stuck at ln 10), which is why the dependency is there.
|
|
|
|
| 48 |
|
| 49 |
`predict_label` takes 16,000 float samples at 16 kHz and returns the command word. Clips shorter than a second are zero-padded and longer ones truncated, matching training exactly. Needs `torch`, `torchaudio` for the mel transform, and `transformers`.
|
| 50 |
|
| 51 |
+
## Predictions
|
| 52 |
+
|
| 53 |
+

|
| 54 |
+
|
| 55 |
+
The first test clip of three words in `testing_list.txt` order, shown as the 64-bin log-mel spectrograms the model actually classifies, with the predicted word, the true word, and the file. All three are correct, which is what the selection rule produced rather than a curated set; overall test accuracy is 0.9116, so roughly one in twelve predictions elsewhere is wrong.
|
| 56 |
+
|
| 57 |
## Training
|
| 58 |
|
| 59 |
Canonical Speech Commands v0.02 via torchaudio, restricted to the ten command words (34,472 train clips after the test split is removed, 4,074 test). Torchaudio's own loader needed torchcodec, whose native library would not load on the training machine, so waveforms were read with scipy and the mel transform uses torchaudio's pure-torch `MelSpectrogram`. An earlier hand-rolled mel filterbank trained to chance (loss stuck at ln 10), which is why the dependency is there.
|