Instructions to use mispeech/dasheng-1.2B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use mispeech/dasheng-1.2B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("audio-classification", model="mispeech/dasheng-1.2B", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mispeech/dasheng-1.2B", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Fix `Tensor.item() cannot be called on meta tensors` error during loading with transformers>=5
#1
by zhoukz - opened
- modeling_dasheng.py +1 -1
modeling_dasheng.py
CHANGED
|
@@ -321,7 +321,7 @@ class AudioTransformerMAE_Encoder(nn.Module):
|
|
| 321 |
|
| 322 |
norm_layer = norm_layer or partial(nn.LayerNorm, eps=1e-6)
|
| 323 |
act_layer = act_layer or nn.GELU
|
| 324 |
-
dpr = [x.item() for x in torch.linspace(0, drop_path_rate, depth)] # stochastic depth decay rule
|
| 325 |
self.pos_drop = nn.Dropout(p=drop_rate)
|
| 326 |
block_function = globals()[block_type]
|
| 327 |
self.blocks = nn.Sequential(
|
|
|
|
| 321 |
|
| 322 |
norm_layer = norm_layer or partial(nn.LayerNorm, eps=1e-6)
|
| 323 |
act_layer = act_layer or nn.GELU
|
| 324 |
+
dpr = [x.item() for x in torch.linspace(0, drop_path_rate, depth, device='cpu')] # stochastic depth decay rule
|
| 325 |
self.pos_drop = nn.Dropout(p=drop_rate)
|
| 326 |
block_function = globals()[block_type]
|
| 327 |
self.blocks = nn.Sequential(
|