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

[TRANSLATION] Initial version for vietnamese #223

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

ngxson
Copy link
Member

@ngxson ngxson commented Feb 21, 2025

WIP, currently all files are generated by scripts/vi-translation.py without any review.

TODO:

  • @xrsrke and I will review it
  • After that @burtenshaw makes a final approval then we can merge

@HuggingFaceDocBuilderDev
Copy link
Collaborator

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@ngxson ngxson changed the title add vietnamese translation (wip) [TRANSLATION] Initial version for vietnamese (wip) Feb 21, 2025
Copy link
Member Author

@ngxson ngxson left a comment

Choose a reason for hiding this comment

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

Hmm ok interestingly it uses vietnamese grammatically better than me lol

2. **Hướng dẫn chu kỳ** (Thought → Action → Observation)

```
Answer the following questions as best you can. You have access to the following tools:
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe provide a translated version of this whole code block

Copy link
Member Author

Choose a reason for hiding this comment

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

Added the translation inside a <details> collapsible block

@ngxson ngxson changed the title [TRANSLATION] Initial version for vietnamese (wip) [TRANSLATION] Initial version for vietnamese Feb 23, 2025
@ngxson ngxson marked this pull request as ready for review February 23, 2025 13:05
@burtenshaw
Copy link
Collaborator

Thanks @ngxson !

Do you think it's possible to parameterise the scripts/vi-translation.py so. that we could use it for other languages? For example, by adding a param for --language="vi" then select the prompt. This would mean that other translators just need to convert the prompt.

@ngxson
Copy link
Member Author

ngxson commented Feb 24, 2025

Yup I generalized the script, user can create a new python file for each language, for example fr.py, then import theauto_translate function:

from translation import auto_translate

output_lang = "fr"

prompt = lambda content: f'''
The prompt here........

=== BEGIN OF TEXT ===
{content}
=== END OF TEXT ===
'''.strip()

auto_translate(
    prompt=prompt,
    output_lang=output_lang,
)

- title: Khi nào các bước tiếp theo được công bố?
sections:
- local: communication/next-units
title: Các Chương tiếp theo
Copy link
Member

Choose a reason for hiding this comment

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

maybe not upper case the second word?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah maybe I did a Ctrl+F replace all and forgot about this. Thanks for reminding!

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm ok seems like not because of that, but the LLM just copy from my example in the prompt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants