raianand commited on
Commit
cc8bea5
1 Parent(s): 51f7033

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +23 -0
README.md CHANGED
@@ -133,6 +133,29 @@ tie_shorts_test = load_dataset("raianand/TIE_shorts", split="test")
133
  tie_shorts_validation = load_dataset("raianand/TIE_shorts", split="validation")
134
  ```
135
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
 
137
  ## Dataset Structure
138
 
 
133
  tie_shorts_validation = load_dataset("raianand/TIE_shorts", split="validation")
134
  ```
135
 
136
+ Inference using [Open AI Whisper](https://huggingface.co/openai/whisper-base) model, :
137
+
138
+ ```python
139
+
140
+ from transformers import WhisperProcessor, WhisperForConditionalGeneration
141
+
142
+
143
+ # load model and processor
144
+ processor = WhisperProcessor.from_pretrained("openai/whisper-base")
145
+ model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-base")
146
+
147
+
148
+
149
+ sample = tie_shorts_test[0]["audio"]
150
+ input_features = processor(sample["array"], sampling_rate=sample["sampling_rate"], return_tensors="pt").input_features
151
+
152
+ # generate token ids
153
+ predicted_ids = model.generate(input_features)
154
+ # decode token ids to text
155
+ transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)
156
+ print(transcription)
157
+ ['the first time and therefore, because I find a lot of them have plagiarized therefore, I will not deduct or make any punishment for plagiarism then what the teacher tends to be arriving it as is arriving']
158
+ ```
159
 
160
  ## Dataset Structure
161