Views
No views yet
AutoFeatureExtractor and AutoModel by setting trust_remote_code=True.1import librosa
2import torch
3from transformers import AutoFeatureExtractor, AutoModel
4model_name = "sbintuitions/nest-ja-0.1b"
5feature_extractor = AutoFeatureExtractor.from_pretrained(model_name, trust_remote_code=True)
6model = AutoModel.from_pretrained(model_name, trust_remote_code=True)
7model.eval()
8audio, sr = librosa.load("path/to/audio.wav", sr=16000)
9inputs = feature_extractor(
10 audio,
11 sampling_rate=sr,
12 return_tensors="pt",
13)
14with torch.inference_mode():
15 outputs = model(**inputs)1# use character-based ASR as example:
2python <NeMo Root>/examples/asr/asr_ctc/speech_to_text_ctc.py \
3 # Config (modify as needed)
4 --config-path=<NeMo Root>/examples/asr/conf/conformer/ \
5 --config-name=conformer_ctc_char \
6 # Required: pretrained model and encoder settings must match nest-ja-0.1b
7 ++init_from_pretrained_model.ssl.name="sbintuitions/nest-ja-0.1b" \
8 ++init_from_pretrained_model.ssl.include=["encoder"] \
9 model.encoder.n_layers=17 \
10 model.encoder.d_model=512 \
11 model.encoder.subsampling="dw_striding" \
12 model.encoder.subsampling_factor=8 \
13 model.encoder.subsampling_conv_channels=256 \
14 model.encoder.conv_kernel_size=9 \
15 model.encoder.conv_norm_type="layer_norm" \
16 model.encoder.xscaling="true" \
17 # Optional: adjust training settings as needed
18 model.train_ds.manifest_filepath=<path to train manifest> \
19 model.validation_ds.manifest_filepath=<path to val/test manifest> \
20 "model.labels=<List of characters>" \
21 trainer.devices=-1 \
22 trainer.accelerator="gpu" \
23 trainer.strategy="ddp" \
24 trainer.max_epochs=100 \
25 model.optim.name="adamw" \
26 model.optim.lr=0.001 \
27 model.optim.betas=[0.9,0.999] \
28 model.optim.weight_decay=0.0001 \
29 model.optim.sched.warmup_steps=2000 \
30 exp_manager.create_wandb_logger=True \
31 exp_manager.wandb_logger_kwargs.name="<Name of experiment>" \
32 exp_manager.wandb_logger_kwargs.project="<Name of project>"1python <NeMo Root>/scripts/ssl/extract_features.py \
2 --model_path="sbintuitions/nest-ja-0.1b" \
3 --input=<path to input manifest, or a dir containing audios, or path to audio> \
4 --output=<output directory to store features and manifest> \
5 --layers="all" \
6 --batch_size=8 \
7 --workers=8| Model | pretrain dataset | data size | param | eval1 | eval2 | eval3 | CSJ average | COJADS | EARS |
|---|---|---|---|---|---|---|---|---|---|
| yky-h/japanese-hubert-base | ReazonSpeech v1 | 19k hours | 90m | 7.11 | 5.21 | 5.22 | 5.84 | 51.8 | 63.6 |
| imprt/kushinada-hubert-base | In-house | 62k hours | 90m | 6.98 | 5.06 | 5.16 | 5.73 | 50.0 | 63.7 |
| sbintuitions/nest-ja-0.1b | ReazonSpeech v2 | 35k hours | 110m | 4.38 | 3.33 | 3.61 | 3.77 | 31.9 | 35.7 |
| Model | pretrain dataset | data size | param | SID↑ | ASV↓ | SD↓ | ER↑ |
|---|---|---|---|---|---|---|---|
| yky-h/japanese-hubert-base | ReazonSpeech v1 | 19k hours | 90m | 60.06 | 11.29 | 4.02 | 60.27 |
| imprt/kushinada-hubert-base | In-house | 62k hours | 90m | 75.15 | 10.25 | 3.64 | 66.35 |
| sbintuitions/nest-ja-0.1b | ReazonSpeech v2 | 35k hours | 110m | 77.40 | 9.21 | 6.05 | 60.00 |