Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions README-vi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
![robotics course](https://huggingface.co/robotics-course/images/resolve/main/banner.png)

# Chào mừng đến với Khóa học 🤗 Robotics

**Language / Ngôn ngữ:** [English](README.md) | [Tiếng Việt](README-vi.md)

## [🪧 Tham gia khóa học trên Hub](https://huggingface.co/robotics-course)

Khóa học miễn phí này sẽ đưa bạn vào một hành trình, **từ robotics cổ điển đến các phương pháp học tập hiện đại**, trong việc hiểu, triển khai và áp dụng các kỹ thuật machine learning vào các hệ thống robot thực tế.

Khóa học này dựa trên [Robot Learning Tutorial](https://huggingface.co/spaces/lerobot/robot-learning-tutorial), một hướng dẫn toàn diện về robot learning dành cho các nhà nghiên cứu và thực hành. Ở đây, chúng tôi đang cố gắng chắt lọc tutorial thành một định dạng dễ tiếp cận hơn cho cộng đồng.

Unit đầu tiên này sẽ giúp bạn làm quen. Bạn sẽ thấy chương trình học và mục tiêu học tập, hiểu về cấu trúc và điều kiện tiên quyết, gặp gỡ đội ngũ đứng sau khóa học, tìm hiểu về LeRobot và hệ sinh thái Hugging Face xung quanh, và khám phá các tài nguyên cộng đồng hỗ trợ hành trình của bạn.

> [!TIP]
> Khóa học này kết nối lý thuyết và thực hành trong Robotics! Nó được thiết kế cho sinh viên quan tâm đến việc hiểu cách machine learning đang biến đổi robotics. Dù bạn mới bắt đầu với robotics hay muốn hiểu các phương pháp dựa trên học tập, khóa học này sẽ hướng dẫn bạn từng bước.

## Bạn sẽ mong đợi gì từ khóa học này?

Trong suốt khóa học, bạn sẽ nghiên cứu nền tảng robotics cổ điển và các phương pháp học tập hiện đại, học cách sử dụng LeRobot, làm việc với các bộ dữ liệu robotics thực tế, và triển khai các thuật toán tiên tiến. Trọng tâm là các kỹ năng thực hành mà bạn có thể áp dụng vào các hệ thống robot thực tế.

Cuối khóa học này, bạn sẽ hiểu:

- cách robot học từ dữ liệu
- tại sao các phương pháp dựa trên học tập đang biến đổi robotics
- cách triển khai các kỹ thuật này bằng các công cụ hiện đại như LeRobot

## Chương trình học là gì?

Đây là chương trình học tổng quát cho khóa học robotics. Mỗi unit được xây dựng dựa trên các unit trước đó để cung cấp cho bạn sự hiểu biết toàn diện về Robotics.

| # | Chủ đề | Mô tả | Đã phát hành |
| - | ----- | ----------- | -------- |
| 0 | Giới thiệu khóa học | Chào mừng, điều kiện tiên quyết và tổng quan khóa học | ✅ |
| 1 | Giới thiệu về Robotics | Tại sao Robotics quan trọng và hệ sinh thái LeRobot | ✅ |
| 2 | Robotics cổ điển | Các phương pháp truyền thống và hạn chế của chúng | ✅ |
| 5 | Reinforcement Learning | Cách robot học thông qua thử và sai | Sắp ra mắt |
| 6 | Imitation Learning | Học từ các mô phỏng và behavioral cloning | Sắp ra mắt |
| 7 | Foundation Models | Các mô hình quy mô lớn cho robotics tổng quát | Sắp ra mắt |

## Lời cảm ơn

Chúng tôi muốn bày tỏ lòng biết ơn đến các dự án và cộng đồng sau:

- [LeRobot](https://github.com/huggingface/lerobot) - Thư viện robotics mã nguồn mở cung cấp sức mạnh cho khóa học này
- [PyTorch](https://pytorch.org) - Framework deep learning được sử dụng xuyên suốt
- Cộng đồng **nghiên cứu robotics** rộng lớn hơn vì đã tạo ra và chia sẻ các bộ dữ liệu và thuật toán làm cho Robotics trở nên khả thi

## Tôi tìm thấy lỗi, hoặc tôi muốn cải thiện khóa học

Các đóng góp rất **được chào đón** 🤗

* Nếu bạn _tìm thấy lỗi hoặc sai sót_, vui lòng [mở một issue](https://github.com/huggingface/robotic-course/issues/new) và **mô tả vấn đề**.
* Nếu bạn _muốn cải thiện khóa học_, bạn có thể đóng góp cho cộng đồng robotics thông qua phát triển LeRobot.
* Nếu bạn _muốn thêm nội dung hoặc đề xuất cải thiện_, hãy tương tác với cộng đồng robotics và chia sẻ ý tưởng của bạn.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

# Welcome to the 🤗 Robotics Course

**Language / Ngôn ngữ:** [English](README.md) | [Tiếng Việt](README-vi.md)

## [🪧 Join the course on the Hub](https://huggingface.co/robotics-course)

This free course will take you on a journey, **from classical robotics to modern learning-based approaches**, in understanding, implementing, and applying machine learning techniques to real robotic systems.
Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
huggingface_hub
python-dotenv
78 changes: 78 additions & 0 deletions scripts/translation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import os
import sys
import re
from huggingface_hub import InferenceClient

# Get the directory containing the current script
script_dir = os.path.dirname(os.path.abspath(__file__))
default_inp_dir = os.path.join(script_dir, '..', 'units/en')
default_model = "deepseek-ai/DeepSeek-R1"
default_client = InferenceClient(
provider="together",
# api_key is read from the environment
)

def auto_translate(
output_lang: str,
prompt: callable,
inp_dir: str = default_inp_dir,
model: str = default_model,
client: InferenceClient = default_client
):
get_output_path = lambda x: x.replace('/en', f'/{output_lang}')
escape_special_tokens = lambda x: x.replace('<think>', '<%%think%%>').replace('</think>', '<%%/think%%>')
unescape_special_tokens = lambda x: x.replace('<%%think%%>', '<think>').replace('<%%/think%%>', '</think>')

# Get the list of all files in the directory, recursively
inp_files: list[str] = []
print('Collecting files...')
for root, dirs, files in os.walk(inp_dir):
for file in files:
if file.endswith('.mdx') or file == "_toctree.yml":
fname = os.path.join(root, file)
print(' +', fname)
inp_files.append(fname)

def write_out_file(fpath: str, content: str):
base_path = os.path.dirname(fpath)
os.makedirs(base_path, exist_ok=True)
with open(fpath, 'w', encoding='utf-8') as f:
f.write(content)

# Read the content of the file and process
for i, inp_file in enumerate(inp_files):
out_file = get_output_path(inp_file)
if os.path.exists(out_file):
print(f'[{i+1}/{len(inp_files)}] Skipping file: {inp_file}')
continue
with open(inp_file, 'r', encoding='utf-8') as f:
content: str = f.read()
content = escape_special_tokens(content)
if content.strip() == "":
print(f'[{i+1}/{len(inp_files)}] Skipping empty file: {inp_file}')
write_out_file(out_file, "")
continue

print(f'[{i+1}/{len(inp_files)}] Processing file: {inp_file}')
stream = client.chat.completions.create(
model=model,
temperature=0.0,
messages=[
{"role": "user", "content": prompt(content)},
],
stream=True,
)
final_text = ""
for chunk in stream:
print(chunk.choices[0].delta.content, end="")
sys.stdout.flush()
final_text += chunk.choices[0].delta.content
# Optionally filter <think>...</think> reasoning process
final_text = final_text.split('</think>').pop().strip()
# Write the output to the file
final_text = unescape_special_tokens(final_text)
write_out_file(out_file, final_text)
print()
print(f' -> Translated to: {out_file}')
print("--" * 20)
#break
119 changes: 119 additions & 0 deletions scripts/vi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
from translation import auto_translate
import os
from dotenv import load_dotenv

# Load environment variables from .env file
load_dotenv()

# Set HF_TOKEN from environment variable
os.environ["HF_TOKEN"] = os.getenv("HF_TOKEN")


output_lang = "vi"

prompt = lambda content: f'''

You are a translator for the Vietnamese translation team. You are tasked with translating the following texts into Vietnamese. You must follow these instructions:
- Translate the texts into Vietnamese, while keeping the original formatting (either Markdown, MDX or HTML)
- Inside code blocks, translate the comments but leave the code as-is; If the code block contains quite plain texts, you MUST provide the translation in <details> tag
- Do not translate inline code, the URLs and file paths
- If the term is abbreviated, keep the original term and provide the translation in parentheses for the first time it appears in the text
- If there are any slag or funny joke in english, keep it (do not translate) and give an explanation so Vietnamese reader can understand
- Use "ta", "mình, "chúng ta", "chúng mình", "các bạn" as pronouns

KEEP THESE TERMS (DO NOT TRANSLATE, do NOT add translation in parentheses): Hugging Face, LeRobot, Transformer, LeRobotDataset, Metadata
For these terms, use the pre-defined translation:
- Onboarding: Làm quen
- Course: Khóa học
- Unit: Chương
- Bonus Unit: Chương bổ trợ
- Module: Mô-đun
- Lesson ...: Bài ...
- Quick Quiz: Kiểm tra nhanh
- Model: Mô hình
- Dataset: Bộ dữ liệu
- Q&A: Hỏi và Đáp
- Hands-on: Thực hành
- Challenge: Bài tập lớn
- Training: Huấn luyện
- Machine learning: Học máy

Here is an example:
- Original text: This free course will take you on a journey, **from classical robotics to modern learning-based approaches**, in understanding, implementing, and applying machine learning techniques to real robotic systems.
- Translation: Khóa học miễn phí này sẽ đưa bạn vào một hành trình, **từ robot cổ điển đến các phương pháp hiện đại dựa trên học máy**, để hiểu, triển khai và áp dụng các kỹ thuật học máy vào các hệ thống robot thực tế.

Here is another example:
- Original text: For more information about robot learning, check out the [Hugging Face documentation](https://huggingface.co/docs/lerobot) and explore our [LeRobot datasets](https://huggingface.co/datasets/lerobot) to get started with your own projects.
- Translation: Để biết thêm thông tin về robot learning, hãy xem [tài liệu Hugging Face](https://huggingface.co/docs/lerobot) và khám phá [bộ dữ liệu LeRobot](https://huggingface.co/datasets/lerobot) của chúng ta để bắt đầu với các dự án của riêng bạn.

Here is an example for academic references:
- Original text: **RT-1: Robotics Transformer for Real-World Control at Scale** (2023)
Anthony Brohan et al.
This paper demonstrates how to apply transformers to real-world robot control at scale, showing the power of learning from large and diverse datasets.
[arXiv:2212.06817](https://huggingface.co/papers/2212.06817)
- Translation: **RT-1: Robotics Transformer for Real-World Control at Scale** (2023)
Anthony Brohan et al.
Bài báo này minh chứng cách áp dụng transformer cho việc điều khiển robot thực tế trên quy mô, cho thấy sức mạnh của việc học từ các tập dữ liệu lớn và đa dạng.
[arXiv:2212.06817](https://huggingface.co/papers/2212.06817)

If the code block contains many plain texts, prove translation in collapsible <details> tag. Example:
- Original text:
```python
# Simple: current observation → current action
delta_timestamps = {{
"observation.images.wrist_camera": [0.0], # Just current frame
"action": [0.0] # Just current action
}}

dataset = LeRobotDataset(
"lerobot/svla_so101_pickplace",
delta_timestamps=delta_timestamps
)
```
- Translation (add the <details> collapsible ABOVE of the original code block):
<details>
<summary>Bấm để xem bản dịch tiếng Việt</summary>
```python
# Đơn giản: quan sát hiện tại → hành động hiện tại
delta_timestamps = {{
"observation.images.wrist_camera": [0.0], # Chỉ frame hiện tại
"action": [0.0] # Chỉ hành động hiện tại
}}

dataset = LeRobotDataset(
"lerobot/svla_so101_pickplace",
delta_timestamps=delta_timestamps
)
```
</details>
```python
# Simple: current observation → current action
delta_timestamps = {{
"observation.images.wrist_camera": [0.0], # Just current frame
"action": [0.0] # Just current action
}}

dataset = LeRobotDataset(
"lerobot/svla_so101_pickplace",
delta_timestamps=delta_timestamps
)
```

IMPORTANT:
- Only output the final translated text and nothing else
- Do NOT include any <think> sections, explanations, or step-by-step analysis
- Do NOT show original text alongside translation
- Do NOT include any commentary or instructions
- Just provide the clean, final Vietnamese translation

Please translate the following texts to Vietnamese:

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

auto_translate(
prompt=prompt,
output_lang=output_lang,
)
30 changes: 30 additions & 0 deletions units/vi/_toctree.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
- title: "0. Chào mừng đến với Khóa học Robotics"
sections:
- local: unit0/1
title: Chào mừng đến với Khóa học Robotics
- local: unit0/2
title: Bắt đầu với LeRobot

- title: "1. Giới thiệu Khóa học"
sections:
- local: unit1/1
title: Giới thiệu về Robot Learning
- local: unit1/2
title: LeRobot - Thư viện Mã nguồn Mở
- local: unit1/3
title: LeRobotDataset
- local: unit1/4
title: "Ví dụ mã: Batching một Bộ dữ liệu (Streaming)"

- title: "2. Robotics Cổ điển"
sections:
- local: unit2/1
title: Giới thiệu về Robotics Cổ điển
- local: unit2/2
title: Các loại chuyển động của Robot
- local: unit2/3
title: Động học Robot
- local: unit2/4
title: Hệ thống Điều khiển và các Hạn chế
- local: unit2/5
title: Từ Robotics Cổ điển đến Robotics dựa trên Học máy
Loading