mananvh commited on
Commit
dca507e
·
verified ·
1 Parent(s): 4bd6ad6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +19 -0
README.md CHANGED
@@ -29,6 +29,25 @@ model-index:
29
  value: 12.33
30
  name: WER
31
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  ## Training and evaluation data
33
 
34
  Training Data:
 
29
  value: 12.33
30
  name: WER
31
 
32
+
33
+ ## Usage
34
+
35
+ In order to infer a single audio file using this model, the following code snippet can be used:
36
+
37
+ ```python
38
+ >>> import torch
39
+ >>> from transformers import pipeline
40
+
41
+ >>> # path to the audio file to be transcribed
42
+ >>> audio = "/path/to/audio.format"
43
+ >>> device = "cuda:0" if torch.cuda.is_available() else "cpu"
44
+
45
+ >>> transcribe = pipeline(task="automatic-speech-recognition", model="mananvh/LLM_GUJARATI", chunk_length_s=30, device=device)
46
+ >>> transcribe.model.config.forced_decoder_ids = transcribe.tokenizer.get_decoder_prompt_ids(language="gu", task="transcribe")
47
+
48
+ >>> print('Transcription: ', transcribe(audio)["text"])
49
+
50
+
51
  ## Training and evaluation data
52
 
53
  Training Data: