Closed rdmueller closed 4 months ago
There is this string
translation_prompt = f"""This is an {source_lang} to {target_lang} translation, please provide the {target_lang} translation for this text. \
Do not provide any explanations or text apart from the translation.
{source_lang}: {source_text}
{target_lang}:"""
the f"""
means format
which replaces all {variable}
with the content of variable
The next line
prompt = translation_prompt.format(source_text=source_text)
also invokes the format but does nothing, since the variables are already substituted.
ohhh makes sense ok ty :)
@rdmueller Thank you for catching this and for opening the PR! In addition to your proposed changes, it looks like a similar update needs to be performed in the one_chunk_reflect_on_translation
function. Would you be able to add this fix to the PR before we merge? Much appreciated!
@methanet correct. I've updated the script accordingly
the line removed was redundant - the
source_text
gets already replaced through the f"-string