radinhas commited on
Commit
42e10c9
1 Parent(s): 4cc7554

Update apis/chat_api.py

Browse files
Files changed (1) hide show
  1. apis/chat_api.py +3 -1
apis/chat_api.py CHANGED
@@ -18,6 +18,7 @@ import requests
18
  from utils.enver import enver
19
  import shutil
20
  import tempfile
 
21
 
22
 
23
  from fastapi import FastAPI, Response, File, UploadFile, Form
@@ -359,7 +360,8 @@ async def whisper_transcribe(
359
  # rv = data.encode('utf-8')
360
  #rv = base64.b64encode(file_data).decode()
361
  #print(rv, "rvrvrvrvr")
362
- text = pipe(tmp_path)["text"]
 
363
  time_end = time.time()
364
  item_response["status"] = 200
365
  item_response["result"] = text
 
18
  from utils.enver import enver
19
  import shutil
20
  import tempfile
21
+ import numpy as np
22
 
23
 
24
  from fastapi import FastAPI, Response, File, UploadFile, Form
 
360
  # rv = data.encode('utf-8')
361
  #rv = base64.b64encode(file_data).decode()
362
  #print(rv, "rvrvrvrvr")
363
+ audio_data = np.fromfile(tmp_path)
364
+ text = pipe(audio_data)["text"]
365
  time_end = time.time()
366
  item_response["status"] = 200
367
  item_response["result"] = text