Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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.
|
| 23 |
-
|
|
|
|
|
|
|
|
|
|
|
|
| 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}
|