Instructions to use mispeech/dasheng-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mispeech/dasheng-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("audio-classification", model="mispeech/dasheng-base", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mispeech/dasheng-base", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Update feature_extraction_dasheng.py
Browse files
feature_extraction_dasheng.py
CHANGED
|
@@ -164,7 +164,8 @@ class DashengFeatureExtractor(SequenceFeatureExtractor):
|
|
| 164 |
raise ValueError(
|
| 165 |
"Input must be a numpy array, a list of numpy arrays, a PyTorch tensor, or a list of PyTorch tensor."
|
| 166 |
)
|
| 167 |
-
|
|
|
|
| 168 |
x = x.float()
|
| 169 |
x = mel_spectrogram(x)
|
| 170 |
x = amplitude_to_db(x)
|
|
|
|
| 164 |
raise ValueError(
|
| 165 |
"Input must be a numpy array, a list of numpy arrays, a PyTorch tensor, or a list of PyTorch tensor."
|
| 166 |
)
|
| 167 |
+
|
| 168 |
+
mel_spectrogram = mel_spectrogram.to(x.device)
|
| 169 |
x = x.float()
|
| 170 |
x = mel_spectrogram(x)
|
| 171 |
x = amplitude_to_db(x)
|