Pranjal12345 commited on
Commit
6bd8168
1 Parent(s): 055d288

updated to medium model

Browse files
Files changed (1) hide show
  1. main.py +3 -10
main.py CHANGED
@@ -38,11 +38,7 @@
38
 
39
 
40
  # # #uvicorn app:app --host 0.0.0.0 --port 8000 --reload
41
- # # #curl -X GET "http://localhost:8000/?text=I%20like%20Apples"
42
- # # #http://localhost:8000/?text=I%20like%20Apples
43
-
44
-
45
-
46
 
47
 
48
 
@@ -144,7 +140,6 @@
144
 
145
 
146
 
147
-
148
  # #uvicorn app:app --host 0.0.0.0 --port 8000 --reload
149
 
150
 
@@ -213,7 +208,6 @@ import librosa
213
  import io
214
  import re
215
 
216
-
217
  html_tag_remover = re.compile(r'<[^>]+>')
218
 
219
  def remove_tags(text):
@@ -221,8 +215,8 @@ def remove_tags(text):
221
 
222
  app = FastAPI()
223
 
224
- processor = WhisperProcessor.from_pretrained("openai/whisper-small")
225
- model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-small")
226
  model.config.forced_decoder_ids = None
227
 
228
  chunk_duration = 30
@@ -267,6 +261,5 @@ async def transcribe_audio(audio_file: UploadFile):
267
  final_transcription = " ".join(transcription)
268
  final_transcription = remove_tags(final_transcription)
269
 
270
-
271
  return final_transcription
272
 
 
38
 
39
 
40
  # # #uvicorn app:app --host 0.0.0.0 --port 8000 --reload
41
+ #
 
 
 
 
42
 
43
 
44
 
 
140
 
141
 
142
 
 
143
  # #uvicorn app:app --host 0.0.0.0 --port 8000 --reload
144
 
145
 
 
208
  import io
209
  import re
210
 
 
211
  html_tag_remover = re.compile(r'<[^>]+>')
212
 
213
  def remove_tags(text):
 
215
 
216
  app = FastAPI()
217
 
218
+ processor = WhisperProcessor.from_pretrained("openai/whisper-medium")
219
+ model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-medium")
220
  model.config.forced_decoder_ids = None
221
 
222
  chunk_duration = 30
 
261
  final_transcription = " ".join(transcription)
262
  final_transcription = remove_tags(final_transcription)
263
 
 
264
  return final_transcription
265