From e0fc605acbb5d78cb7a58a98bc8bd8f0056df49c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ralf=20D=2E=20M=C3=BCller?= Date: Mon, 8 Jul 2024 23:12:33 +0200 Subject: [PATCH] remove redundant line (#8) * remove redundant line the line removed was redundant - the `source_text` gets already replaced through the f"-string * Update utils.py --- src/translation_agent/utils.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/translation_agent/utils.py b/src/translation_agent/utils.py index 549dac3..7a48969 100755 --- a/src/translation_agent/utils.py +++ b/src/translation_agent/utils.py @@ -92,9 +92,7 @@ def one_chunk_initial_translation( {target_lang}:""" - prompt = translation_prompt.format(source_text=source_text) - - translation = get_completion(prompt, system_message=system_message) + translation = get_completion(translation_prompt, system_message=system_message) return translation @@ -170,13 +168,7 @@ def one_chunk_reflect_on_translation( Each suggestion should address one specific part of the translation. Output only the suggestions and nothing else.""" - prompt = reflection_prompt.format( - source_lang=source_lang, - target_lang=target_lang, - source_text=source_text, - translation_1=translation_1, - ) - reflection = get_completion(prompt, system_message=system_message) + reflection = get_completion(reflection_prompt, system_message=system_message) return reflection