radinhas commited on
Commit
c4db11d
1 Parent(s): 57ddf4b

Update apis/chat_api.py

Browse files
Files changed (1) hide show
  1. apis/chat_api.py +5 -3
apis/chat_api.py CHANGED
@@ -348,9 +348,11 @@ async def whisper_transcribe(
348
  )
349
  time_start = time.time()
350
  pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(language=language, task="transcribe")
351
- #file_data = await audio_file.file.read()
352
- file_data = audio_file.file.read()
353
- text = pipe(file_data)["text"]
 
 
354
  time_end = time.time()
355
  item_response["status"] = 200
356
  item_response["result"] = text
 
348
  )
349
  time_start = time.time()
350
  pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(language=language, task="transcribe")
351
+ file_data = await audio_file.read()
352
+ # rv = data.encode('utf-8')
353
+ rv = base64.b64encode(file_data)
354
+ print(rv, "rvrvrvrvr")
355
+ text = pipe(rv)["text"]
356
  time_end = time.time()
357
  item_response["status"] = 200
358
  item_response["result"] = text