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

remove redundant line #8

Merged
merged 2 commits into from
Jul 8, 2024
Merged

remove redundant line #8

merged 2 commits into from
Jul 8, 2024

Conversation

rdmueller
Copy link
Contributor

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

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

@siddhantx0 siddhantx0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this mean?

@rdmueller
Copy link
Contributor Author

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.

@siddhantx0
Copy link

ohhh makes sense ok ty :)

@methanet
Copy link
Collaborator

@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 methanet added the bug Something isn't working label Jun 28, 2024
@j-dominguez9 j-dominguez9 added good first issue Good for newcomers and removed bug Something isn't working labels Jun 28, 2024
@rdmueller
Copy link
Contributor Author

@methanet correct. I've updated the script accordingly

@j-dominguez9 j-dominguez9 merged commit e0fc605 into andrewyng:main Jul 8, 2024
1 check passed
@rdmueller rdmueller deleted the patch-1 branch July 11, 2024 20:40
Salah-Sal pushed a commit to Salah-Sal/translation-agent that referenced this pull request Jul 12, 2024
* remove redundant line

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

* Update utils.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants