Skip to content

Commit

Permalink
add temp logs
Browse files Browse the repository at this point in the history
  • Loading branch information
kumarpanzade committed Sep 26, 2024
1 parent 8640a1e commit 5e6053f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions service/audio_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def translate_with_whisper(audioPath):
logger.info("Started transciption through whishper")
# audio_tensor = np_array_to_tensor(audio)
# stft_result = perform_stft(audio_tensor)
print("----------------",audioPath,"---------------------")
options = dict(beam_size=5, best_of=5)
translate_options = dict(task="translate", **options)
result = model.transcribe(audioPath,**translate_options)
Expand Down
3 changes: 2 additions & 1 deletion service/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ async def upload_audio(body: Body):
translation = translate_with_whisper(body.audio_file_link)

logger.info("translation done")
print("---------- -----------summary started-----------------------")
print("---------------------summary started-----------------------")
#summary = summarize_using_openai(translation)
summary = summarize_using_openai(translation)

Expand All @@ -47,4 +47,5 @@ async def upload_audio(body: Body):
return JSONResponse(content={"message": "File processed successfully!", "translation":translation, "summary": summary}, status_code=200)

except Exception as e:
print("---------------",e,"-------------------")
return JSONResponse(content={"message": str(e)}, status_code=500)

0 comments on commit 5e6053f

Please sign in to comment.