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, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Update README.md
Browse files
README.md
CHANGED
|
@@ -31,11 +31,11 @@ pip install git+https://github.com/jimbozhang/hf_transformers_custom_model_dashe
|
|
| 31 |
>>> feature_extractor = AutoFeatureExtractor.from_pretrained(model_name, trust_remote_code=True)
|
| 32 |
>>> model = AutoModel.from_pretrained(model_name, outputdim=None, trust_remote_code=True)
|
| 33 |
|
|
|
|
| 34 |
>>> inputs = feature_extractor(torch.randn(1, 16000), sampling_rate=sampling_rate, return_tensors="pt")
|
| 35 |
>>> inputs.input_values.shape
|
| 36 |
torch.Size([1, 64, 101]) # 64 mel-filterbanks, 101 frames
|
| 37 |
|
| 38 |
-
>>> import torch
|
| 39 |
>>> with torch.no_grad():
|
| 40 |
... outputs = model(**inputs)
|
| 41 |
|
|
|
|
| 31 |
>>> feature_extractor = AutoFeatureExtractor.from_pretrained(model_name, trust_remote_code=True)
|
| 32 |
>>> model = AutoModel.from_pretrained(model_name, outputdim=None, trust_remote_code=True)
|
| 33 |
|
| 34 |
+
>>> import torch
|
| 35 |
>>> inputs = feature_extractor(torch.randn(1, 16000), sampling_rate=sampling_rate, return_tensors="pt")
|
| 36 |
>>> inputs.input_values.shape
|
| 37 |
torch.Size([1, 64, 101]) # 64 mel-filterbanks, 101 frames
|
| 38 |
|
|
|
|
| 39 |
>>> with torch.no_grad():
|
| 40 |
... outputs = model(**inputs)
|
| 41 |
|