Views
No views yet
310326-forced-aligner31.03.2026Beta notice: this checkpoint is for controlled evaluation and integration work. APIs, naming, packaging advice, and companion repo IDs may still change during the beta period.
Qwen3-0.6B-Forced-Aligner-310326model.safetensors and generation_config.json from the new local training outputconfig.json from assets/TEMPLATE_FORCED_ALIGNER_config.json, which replaces the default forced-aligner confighfrepos/nb-asr-beta1-qwen-forced-alignerqwen-asr package, which provides the compatible classes and loading behavior for Qwen ASR and forced-aligner checkpoints.pip install -U "qwen-asr"pip install -U flash-attn --no-build-isolationpip install -U "qwen-asr[vllm]"align with audio, text, and language.1import torch
2from qwen_asr import Qwen3ForcedAligner
3
4model = Qwen3ForcedAligner.from_pretrained(
5 "NbAiLab/nb-asr-beta-qwen06b-310326-forced-aligner",
6 dtype=torch.bfloat16,
7 device_map="cuda:0",
8 # attn_implementation="flash_attention_2",
9)
10
11results = model.align(
12 audio="audio.wav",
13 text="Hun er oversatt til en rekke språk, men ikke norsk.",
14 language="Norwegian",
15)
16
17print(results[0])
18first = results[0][0]
19print(first.text, first.start_time, first.end_time)forced_aligner to this repo.1import torch
2from qwen_asr import Qwen3ASRModel
3
4ASR_MODEL = "NbAiLab/nb-asr-beta-qwen06b-lunde03-reading"
5ALIGNER_MODEL = "NbAiLab/nb-asr-beta-qwen06b-310326-forced-aligner"
6
7model = Qwen3ASRModel.from_pretrained(
8 ASR_MODEL,
9 dtype=torch.bfloat16,
10 device_map="cuda:0",
11 max_inference_batch_size=8,
12 max_new_tokens=1024,
13 forced_aligner=ALIGNER_MODEL,
14 forced_aligner_kwargs=dict(
15 dtype=torch.bfloat16,
16 device_map="cuda:0",
17 ),
18)
19
20results = model.transcribe(
21 audio=["/path/to/utt1.wav", "/path/to/utt2.wav"],
22 language=["Norwegian", "Norwegian"],
23 return_time_stamps=True,
24)
25
26for r in results:
27 print(r.language, r.text, r.time_stamps[0] if r.time_stamps else None)1import torch
2from qwen_asr import Qwen3ASRModel
3
4if __name__ == "__main__":
5 ASR_MODEL = "NbAiLab/nb-asr-beta-qwen06b-lunde03-reading"
6 ALIGNER_MODEL = "NbAiLab/nb-asr-beta-qwen06b-310326-forced-aligner"
7
8 model = Qwen3ASRModel.LLM(
9 model=ASR_MODEL,
10 gpu_memory_utilization=0.7,
11 max_inference_batch_size=32,
12 max_new_tokens=4096,
13 forced_aligner=ALIGNER_MODEL,
14 forced_aligner_kwargs=dict(
15 dtype=torch.bfloat16,
16 device_map="cuda:0",
17 ),
18 )
19
20 results = model.transcribe(
21 audio=["/path/to/audio.wav"],
22 language=["Norwegian"],
23 return_time_stamps=True,
24 )
25
26 for r in results:
27 print(r.language, r.text, r.time_stamps)--aligner-checkpoint NbAiLab/nb-asr-beta-qwen06b-310326-forced-aligner1pip install -U "huggingface_hub[cli]"
2hf download NbAiLab/nb-asr-beta-qwen06b-310326-forced-aligner --local-dir ./nb-asr-beta-qwen06b-310326-forced-alignermodel.safetensorsgeneration_config.jsonconfig.jsontokenizer.jsontokenizer_config.jsonspecial_tokens_map.jsonvocab.jsonmerges.txtadded_tokens.jsonchat_template.jinjapreprocessor_config.jsonaudio.wav