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.6b"
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.6b
7 ++init_from_pretrained_model.ssl.name="sbintuitions/nest-ja-0.6b" \
8 ++init_from_pretrained_model.ssl.include=["encoder"] \
9 model.encoder.n_layers=24 \
10 model.encoder.d_model=1024 \
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="false" \
17 model.encoder.use_bias="false" \
18 # Optional: adjust training settings as needed
19 model.train_ds.manifest_filepath=<path to train manifest> \
20 model.validation_ds.manifest_filepath=<path to val/test manifest> \
21 "model.labels=<List of characters>" \
22 trainer.devices=-1 \
23 trainer.accelerator="gpu" \
24 trainer.strategy="ddp" \
25 trainer.max_epochs=100 \
26 model.optim.name="adamw" \
27 model.optim.lr=0.001 \
28 model.optim.betas=[0.9,0.999] \
29 model.optim.weight_decay=0.0001 \
30 model.optim.sched.warmup_steps=2000 \
31 exp_manager.create_wandb_logger=True \
32 exp_manager.wandb_logger_kwargs.name="<Name of experiment>" \
33 exp_manager.wandb_logger_kwargs.project="<Name of project>"1python <NeMo Root>/scripts/ssl/extract_features.py \
2 --model_path="sbintuitions/nest-ja-0.6b" \
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-large | ReazonSpeech v1 | 19k hours | 0.3B | 4.09 | 2.80 | 3.11 | 3.33 | 44.9 | 36.1 |
| imprt/kushinada-hubert-large | In-house | 62k hours | 0.3B | 4.14 | 3.10 | 3.31 | 3.51 | 43.8 | 36.5 |
| sbintuitions/nest-ja-0.6b | ReazonSpeech v2 | 35k hours | 0.6B | 4.01 | 2.98 | 3.31 | 3.43 | 29.7 | 34.1 |
| Model | pretrain dataset | data size | param | SID↑ | ASV↓ | SD↓ | ER↑ |
|---|---|---|---|---|---|---|---|
| yky-h/japanese-hubert-large | ReazonSpeech v1 | 19k hours | 0.3B | 84.97 | 7.33 | 3.32 | 70.69 |
| imprt/kushinada-hubert-large | In-house | 62k hours | 0.3B | 88.01 | 7.21 | 3.41 | 67.18 |
| sbintuitions/nest-ja-0.6b | ReazonSpeech v2 | 35k hours | 0.6B | 90.20 | 7.26 | 4.80 | 64.24 |