How to deploy this on google collab?
#1
by
awesome8
- opened
Hi,
I want to deploy your model on google colab and use it to transcribe Malayalam. I would be grateful if you could share how to do that. I'm a newbie, so if you can share a step by step tutorial that would be really helpful.
Thanks in advance.
Hey man the code he shared on the description should work
from transformers import pipeline, WhisperProcessor
processor = WhisperProcessor.from_pretrained("thennal/whisper-medium-ml")
forced_decoder_ids = processor.get_decoder_prompt_ids(language="ml", task="translate")
asr = pipeline(
"automatic-speech-recognition", model="thennal/whisper-medium-ml", device=0,
)
transcription = asr("audios/real_class.mp3", chunk_length_s=30, max_new_tokens=448, return_timestamps=False, generate_kwargs={
"forced_decoder_ids": forced_decoder_ids,
"do_sample": True,
})
print(transcription)
with open("dump.txt", "w") as f:
f.writelines(transcription["text"])
This is a script i used for my project.
Also make sure to install the correct dependencies as mentioned at the bottom of the description page ( the newer versions break this one )