# Hướng dẫn từ Cộng đồng

Các hướng dẫn cộng đồng được tạo ra bởi những thành viên tích cực của cộng đồng Hugging Face, những người muốn chia sẻ kiến thức và chuyên môn của mình với người khác. Đây là cách tuyệt vời để tìm hiểu về thư viện và các tính năng của nó, cũng như để bắt đầu với các lớp và phương thức cốt lõi.

## Mô hình ngôn ngữ

### Hướng dẫn

| Nhiệm vụ | Lớp | Mô tả | Tác giả | Hướng dẫn | Colab |
| --- | --- | --- | --- | --- | --- |
| Học tăng cường | [GRPOTrainer](/docs/trl/v1.18.2/vi/grpo_trainer#trl.GRPOTrainer) | Huấn luyện trực tuyến hiệu quả với GRPO và vLLM trong TRL | [Sergio Paniego](https://huggingface.co/sergiopaniego) | [Liên kết](https://huggingface.co/learn/cookbook/grpo_vllm_online_training) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/cookbook/blob/main/notebooks/en/grpo_vllm_online_training.ipynb) |
| Học tăng cường | [GRPOTrainer](/docs/trl/v1.18.2/vi/grpo_trainer#trl.GRPOTrainer) | Huấn luyện lại LLM cho suy luận bằng GRPO trong TRL | [Sergio Paniego](https://huggingface.co/sergiopaniego) | [Liên kết](https://huggingface.co/learn/cookbook/fine_tuning_llm_grpo_trl) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/cookbook/blob/main/notebooks/en/fine_tuning_llm_grpo_trl.ipynb) |
| Học tăng cường | [GRPOTrainer](/docs/trl/v1.18.2/vi/grpo_trainer#trl.GRPOTrainer) | Mini-R1: Tái hiện khoảnh khắc „aha“ của Deepseek R1, một hướng dẫn RL | [Philipp Schmid](https://huggingface.co/philschmid) | [Liên kết](https://www.philschmid.de/mini-deepseek-r1) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/philschmid/deep-learning-pytorch-huggingface/blob/main/training/mini-deepseek-r1-aha-grpo.ipynb) |
| Học tăng cường | [GRPOTrainer](/docs/trl/v1.18.2/vi/grpo_trainer#trl.GRPOTrainer) | RL trên LLaMA 3.1-8B với GRPO và các tối ưu hóa Unsloth | [Andrea Manzoni](https://huggingface.co/AManzoni) | [Liên kết](https://colab.research.google.com/github/amanzoni1/fine_tuning/blob/main/RL_LLama3_1_8B_GRPO.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/amanzoni1/fine_tuning/blob/main/RL_LLama3_1_8B_GRPO.ipynb) |
| Điều chỉnh theo hướng dẫn | [SFTTrainer](/docs/trl/v1.18.2/vi/sft_trainer#trl.SFTTrainer) | Tinh chỉnh các LLM Google Gemma sử dụng định dạng ChatML với QLoRA | [Philipp Schmid](https://huggingface.co/philschmid) | [Liên kết](https://www.philschmid.de/fine-tune-google-gemma) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/philschmid/deep-learning-pytorch-huggingface/blob/main/training/gemma-lora-example.ipynb) |
| Tạo có cấu trúc | [SFTTrainer](/docs/trl/v1.18.2/vi/sft_trainer#trl.SFTTrainer) | Tinh chỉnh Llama-2-7B để tạo danh mục sản phẩm tiếng Ba Tư ở định dạng JSON bằng QLoRA và PEFT | [Mohammadreza Esmaeilian](https://huggingface.co/Mohammadreza) | [Liên kết](https://huggingface.co/learn/cookbook/en/fine_tuning_llm_to_generate_persian_product_catalogs_in_json_format) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/cookbook/blob/main/notebooks/en/fine_tuning_llm_to_generate_persian_product_catalogs_in_json_format.ipynb) |
| Tối ưu hóa sở thích | [DPOTrainer](/docs/trl/v1.18.2/vi/dpo_trainer#trl.DPOTrainer) | Căn chỉnh Mistral-7b bằng Tối ưu hóa Sở thích Trực tiếp (Direct Preference Optimization) để căn chỉnh theo sở thích của con người | [Maxime Labonne](https://huggingface.co/mlabonne) | [Liên kết](https://mlabonne.github.io/blog/posts/Fine_tune_Mistral_7b_with_DPO.html) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/mlabonne/llm-course/blob/main/Fine_tune_a_Mistral_7b_model_with_DPO.ipynb) |
| Tối ưu hóa sở thích | [experimental.orpo.ORPOTrainer](/docs/trl/v1.18.2/vi/orpo_trainer#trl.experimental.orpo.ORPOTrainer) | Tinh chỉnh Llama 3 bằng ORPO kết hợp tinh chỉnh theo chỉ dẫn và căn chỉnh sở thích | [Maxime Labonne](https://huggingface.co/mlabonne) | [Liên kết](https://mlabonne.github.io/blog/posts/2024-04-19_Fine_tune_Llama_3_with_ORPO.html) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1eHNWg9gnaXErdAa8_mcvjMupbSS6rDvi) |
| Điều chỉnh theo hướng dẫn | [SFTTrainer](/docs/trl/v1.18.2/vi/sft_trainer#trl.SFTTrainer) | Cách tinh chỉnh các LLM mã nguồn mở trong năm 2025 với Hugging Face | [Philipp Schmid](https://huggingface.co/philschmid) | [Liên kết](https://www.philschmid.de/fine-tune-llms-in-2025) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/philschmid/deep-learning-pytorch-huggingface/blob/main/training/fine-tune-llms-in-2025.ipynb) |
| Lý luận theo từng bước | [GRPOTrainer](/docs/trl/v1.18.2/vi/grpo_trainer#trl.GRPOTrainer) | Học tăng cường có giám sát (SRL) cho suy luận từng bước với vLLM | [Deepak Swaminathan](https://huggingface.co/s23deepak) | [Liên kết](https://github.com/s23deepak/Supervised-Reinforcement-Learning) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/s23deepak/Supervised-Reinforcement-Learning/blob/main/notebooks/srl_grpo_tutorial.ipynb) |

### Video

| Nhiệm vụ | Tiêu đề | Tác giả | Video |
| --- | --- | --- | --- |
| Điều chỉnh theo hướng dẫn | Tinh chỉnh các mô hình AI mã nguồn mở bằng Hugging Face TRL | [Wietse Venema](https://huggingface.co/wietsevenema) | [](https://youtu.be/cnGyyM0vOes) |
| Điều chỉnh theo hướng dẫn | Cách tinh chỉnh một smol-LM với Hugging Face, TRL và bộ dữ liệu smoltalk | [Mayurji](https://huggingface.co/iammayur) | [](https://youtu.be/jKdXv3BiLu0) |

⚠️ Thông báo về các tính năng đã ngừng hỗ trợ trong “Cách tinh chỉnh một smol-LM bằng Hugging Face, TRL và bộ dữ liệu smoltalk” (nhấp để mở rộng)

> [!WARNING]
> Hướng dẫn sử dụng hai tính năng đã bị ngừng hỗ trợ:
>
> - `SFTTrainer(..., tokenizer=tokenizer)`: Hãy dùng `SFTTrainer(..., processing_class=tokenizer)` thay thế, hoặc đơn giản là bỏ qua tham số này (nó sẽ được suy ra từ model). - `setup_chat_format(model, tokenizer)`: Hãy dùng `SFTConfig(..., chat_template_path="Qwen/Qwen3-0.6B")`, trong đó `chat_template_path` chỉ định model mà bạn muốn sao chép chat template.

## Mô hình Ngôn ngữ Thị giác

### Hướng dẫn

| Nhiệm vụ | Lớp | Mô tả | Tác giả | Hướng dẫn | Colab |
| --- | --- | --- | --- | --- | --- |
| Kiểm tra chất lượng trực quan | [SFTTrainer](/docs/trl/v1.18.2/vi/sft_trainer#trl.SFTTrainer) | Tinh chỉnh Qwen2-VL-7B cho câu hỏi trả lời trực quan trên bộ dữ liệu ChartQA | [Sergio Paniego](https://huggingface.co/sergiopaniego) | [Liên kết](https://huggingface.co/learn/cookbook/fine_tuning_vlm_trl) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/cookbook/blob/main/notebooks/en/fine_tuning_vlm_trl.ipynb) |
| Kiểm tra chất lượng trực quan | [SFTTrainer](/docs/trl/v1.18.2/vi/sft_trainer#trl.SFTTrainer) | Tinh chỉnh SmolVLM bằng TRL trên GPU tiêu dùng | [Sergio Paniego](https://huggingface.co/sergiopaniego) | [Liên kết](https://huggingface.co/learn/cookbook/fine_tuning_smol_vlm_sft_trl) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/cookbook/blob/main/notebooks/en/fine_tuning_smol_vlm_sft_trl.ipynb) |
| Mô tả SEO | [SFTTrainer](/docs/trl/v1.18.2/vi/sft_trainer#trl.SFTTrainer) | Tinh chỉnh Qwen2-VL-7B để tạo mô tả thân thiện với SEO từ hình ảnh | [Philipp Schmid](https://huggingface.co/philschmid) | [Liên kết](https://www.philschmid.de/fine-tune-multimodal-llms-with-trl) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/philschmid/deep-learning-pytorch-huggingface/blob/main/training/fine-tune-multimodal-llms-with-trl.ipynb) |
| Kiểm tra chất lượng trực quan | [DPOTrainer](/docs/trl/v1.18.2/vi/dpo_trainer#trl.DPOTrainer) | PaliGemma 🤝 Tối ưu hóa sở thích trực tiếp | [Merve Noyan](https://huggingface.co/merve) | [Liên kết](https://github.com/merveenoyan/smol-vision/blob/main/PaliGemma_DPO.ipynb) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/merveenoyan/smol-vision/blob/main/PaliGemma_DPO.ipynb) |
| Kiểm tra chất lượng trực quan | [DPOTrainer](/docs/trl/v1.18.2/vi/dpo_trainer#trl.DPOTrainer) | Tinh chỉnh SmolVLM bằng tối ưu hóa sở thích trực tiếp (DPO) với TRL trên GPU tiêu dùng | [Sergio Paniego](https://huggingface.co/sergiopaniego) | [Liên kết](https://huggingface.co/learn/cookbook/fine_tuning_vlm_dpo_smolvlm_instruct) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/cookbook/blob/main/notebooks/en/fine_tuning_vlm_dpo_smolvlm_instruct.ipynb) |
| Định vị phát hiện đối tượng | [SFTTrainer](/docs/trl/v1.18.2/vi/sft_trainer#trl.SFTTrainer) | Fine tuning một VLM cho Object Detection Grounding bằng TRL | [Sergio Paniego](https://huggingface.co/sergiopaniego) | [Liên kết](https://huggingface.co/learn/cookbook/fine_tuning_vlm_object_detection_grounding) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/cookbook/blob/main/notebooks/en/fine_tuning_vlm_object_detection_grounding.ipynb) |
| Kiểm tra chất lượng trực quan | [DPOTrainer](/docs/trl/v1.18.2/vi/dpo_trainer#trl.DPOTrainer) | Chỉnh huấn luyện Mô hình Ngôn ngữ Thị giác bằng TRL sử dụng MPO | [Sergio Paniego](https://huggingface.co/sergiopaniego) | [Liên kết](https://huggingface.co/learn/cookbook/fine_tuning_vlm_mpo) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/cookbook/blob/main/notebooks/en/fine_tuning_vlm_mpo.ipynb) |
| Học tăng cường | [GRPOTrainer](/docs/trl/v1.18.2/vi/grpo_trainer#trl.GRPOTrainer) | Huấn luyện sau một VLM cho suy luận bằng GRPO sử dụng TRL | [Sergio Paniego](https://huggingface.co/sergiopaniego) | [Liên kết](https://huggingface.co/learn/cookbook/fine_tuning_vlm_grpo_trl) | [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/cookbook/blob/main/notebooks/en/fine_tuning_vlm_grpo_trl.ipynb) |

## Mô hình ngôn ngữ giọng nói

### Hướng dẫn

| Nhiệm vụ | Lớp | Mô tả | Tác giả | Hướng dẫn |
| --- | --- | --- | --- | --- |
| Text-to-Speech | [GRPOTrainer](/docs/trl/v1.18.2/vi/grpo_trainer#trl.GRPOTrainer) | Huấn luyện lại Mô hình Ngôn ngữ Âm thanh bằng GRPO sử dụng TRL | [Steven Zheng](https://huggingface.co/Steveeeeeeen) | [Liên kết](https://huggingface.co/blog/Steveeeeeeen/llasa-grpo) |

## Đóng góp

Nếu bạn có một bài hướng dẫn muốn thêm vào danh sách này, vui lòng mở một PR để thêm nó. Chúng tôi sẽ xem xét và hợp nhất nếu nó phù hợp với cộng đồng.

