DPWXY15 commited on
Commit
042042c
·
verified ·
1 Parent(s): efd0483

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -19,5 +19,8 @@ async def chat(req: Request):
19
  @app.post("/transcribe")
20
  async def transcribe(file: UploadFile = File(...)):
21
  audio_data = await file.read()
22
- response = openai.Audio.transcribe("whisper-1", audio_data)
23
- return {"text": response["text"]}
 
 
 
 
19
  @app.post("/transcribe")
20
  async def transcribe(file: UploadFile = File(...)):
21
  audio_data = await file.read()
22
+ response = transcript = openai.audio.transcriptions.create(
23
+ model="whisper-1",
24
+ file=audio_data
25
+ )
26
+ return {"text": response.text}