Skip to content

Commit

Permalink
remove redundant line (#8)
Browse files Browse the repository at this point in the history
* remove redundant line

the line removed was redundant - the `source_text` gets already replaced through the f"-string

* Update utils.py
  • Loading branch information
rdmueller authored Jul 8, 2024
1 parent 2f0c344 commit e0fc605
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/translation_agent/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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


Expand Down

0 comments on commit e0fc605

Please sign in to comment.