Enpas commited on
Commit
3db093b
1 Parent(s): 24f4797

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +13 -0
README.md ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ```
2
+ import torch
3
+ from transformers import pipeline
4
+
5
+ device = "cuda:0" if torch.cuda.is_available() else "cpu"
6
+
7
+ transcribe = pipeline(task="automatic-speech-recognition", model="Enpas/whisper-small-co", chunk_length_s=30, device=device)
8
+ transcribe.model.config.forced_decoder_ids = transcribe.tokenizer.get_decoder_prompt_ids(language="am", task="transcribe")
9
+
10
+ audio = "/content/tr_10000_tr097082.wav"
11
+ result = transcribe(audio)
12
+ print('Transcription: ', result["text"])
13
+ ```