Views
No views yet
ms, Malay, can be standard malay and local malay.en, English, can be standard english and manglish.1from transformers import AutoProcessor, AutoModelForSpeechSeq2Seq, pipeline
2from datasets import Audio
3import requests
4
5sr = 16000
6audio = Audio(sampling_rate=sr)
7
8processor = AutoProcessor.from_pretrained("mesolitica/malaysian-whisper-base")
9model = AutoModelForSpeechSeq2Seq.from_pretrained("mesolitica/malaysian-whisper-base")
10
11r = requests.get('https://huggingface.co/datasets/huseinzol05/malaya-speech-stt-test-set/resolve/main/test.mp3')
12y = audio.decode_example(audio.encode_example(r.content))['array']
13inputs = processor([y], return_tensors = 'pt')
14r = model.generate(inputs['input_features'], language='ms', return_timestamps=True)
15processor.tokenizer.decode(r[0])'<|startoftranscript|><|ms|><|transcribe|> Zamily On Aging di Vener Australia, Australia yang telah diadakan pada tahun 1982 dan berasaskan unjuran tersebut maka jabatan perangkaan Malaysia menganggarkan menjelang tahun 2005 sejumlah 15% penduduk kita adalah daripada kalangan warga emas. Untuk makluman Tuan Yang Pertua dan juga Alian Bohon, pembangunan sistem pendafiran warga emas ataupun kita sebutkan event adalah usaha kerajaan ke arah merealisasikan objektif yang telah digangkatkan<|endoftext|>'1r = model.generate(inputs['input_features'], language='en', return_timestamps=True)
2processor.tokenizer.decode(r[0])<|startoftranscript|><|en|><|transcribe|> Assembly on Aging, Divina Australia, Australia, which has been provided in 1982 and the operation of the transportation of Malaysia's implementation to prevent the tourism of the 25th, 15% of our population is from the market. For the information of the President and also the respected, the development of the market system or we have made an event.<|endoftext|>