Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add task id and language in logging info #951

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions backend/voiceover/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ def upload_zip_to_azure(zip_file_path):
return blob_client_zip.url


def get_tts_output(tts_input, target_language, multiple_speaker, gender):
logging.info("Calling TTS API")
def get_tts_output(tts_input, target_language, multiple_speaker, gender, id):
logging.info("Calling TTS API for %s task in %s language", str(id), str(target_language))
tts_url = get_tts_url(target_language)
if tts_url is None:
return {
Expand Down Expand Up @@ -285,6 +285,7 @@ def generate_tts_output(
target_language,
translation_obj.video.multiple_speaker,
gender.lower(),
translation_obj.id,
)
logging.info("output generated")
else:
Expand All @@ -306,6 +307,7 @@ def generate_tts_output(
target_language,
translation_obj.video.multiple_speaker,
speaker_info[speaker_id],
translation_obj.id,
)
if (
type(speaker_tts_output) != dict
Expand Down Expand Up @@ -1035,7 +1037,7 @@ def generate_voiceover_payload(translation_payload, target_language, task):
else:
gender = task.video.gender
voiceover_machine_generated = get_tts_output(
tts_input, target_language, task.video.multiple_speaker, gender.lower()
tts_input, target_language, task.video.multiple_speaker, gender.lower(), task.id
)
if (
type(voiceover_machine_generated) == dict
Expand Down
Loading