Skip to content

Commit

Permalink
update : stt api code
Browse files Browse the repository at this point in the history
  • Loading branch information
MinDongRyul authored Nov 9, 2023
1 parent 4248021 commit 5b3c455
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fastapi_backend/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
from transformers import Wav2Vec2Processor, Wav2Vec2ForCTC
import soundfile as sf
import librosa
import openai

import requests
import time
Expand Down Expand Up @@ -638,7 +639,7 @@ async def transcribe_api_endpoint(client_id: str = Form(...),
temp_file_path = temp_file.name

with open(temp_file_path, 'rb') as open_audio_file:
transcription = openai.Audio.transcribe(model="whisper-1", file=open_audio_file, response_format="text", language='ko')
transcript = openai.audio.transcriptions.create(model="whisper-1", file=open_audio_file, response_format="text")

return {"transcription": transcription}
return {"transcription": transcript}
########### Speech2Text End #############

0 comments on commit 5b3c455

Please sign in to comment.