Skip to content
Snippets Groups Projects

Feature/add auth asr service

Merged Marcin Wątroba requested to merge feature/add_auth_asr_service into main
Viewing commit f9d36ebb
Show latest version
3 files
+ 17
4
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -36,13 +36,19 @@ class AsrBaseProcessor(ABC):
try:
transcription = self.process_asr(file_path)
os.remove(file_path)
result_object = jsonify(
{"transcription": transcription.words, "full_text": transcription.full_text}
)
response_dict = {
"transcription": transcription.words,
"full_text": transcription.full_text,
"words_time_alignment": transcription.words_time_alignment
}
result_object = jsonify(response_dict)
except Exception as exception:
print(exception)
traceback.print_exc()
result_object = jsonify({"error": "Error on asr processing"})
finally:
if os.path.isfile(file_path):
os.remove(file_path)
else:
result_object = jsonify({"error": "Error on asr processing"})
return result_object