Skip to content

Commit 064d497

Browse files
committed
Merge branch 'main' of github.com:huggingface/course into bin-to-safetensors
2 parents 9b8c645 + 15cf873 commit 064d497

File tree

297 files changed

+38166
-5373
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

297 files changed

+38166
-5373
lines changed

.github/workflows/build_documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ jobs:
1414
package: course
1515
path_to_docs: course/chapters/
1616
additional_args: --not_python_module
17-
languages: ar bn de en es fa fr gj he hi id it ja ko pt ru th tr vi zh-CN zh-TW
17+
languages: ar bn de en es fa fr gj he hi id it ja ko ne pl pt ru rum te th tr vi zh-CN zh-TW
1818
secrets:
1919
hf_token: ${{ secrets.HF_DOC_BUILD_PUSH }}

.github/workflows/build_pr_documentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
package: course
1717
path_to_docs: course/chapters/
1818
additional_args: --not_python_module
19-
languages: ar bn de en es fa fr gj he hi id it ja ko pt ru th tr vi zh-CN zh-TW
19+
languages: ar bn de en es fa fr gj he hi id it ja ko ne pl pt ru rum te th tr vi zh-CN zh-TW

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,13 @@ This repo contains the content that's used to create the **[Hugging Face course]
2121
| [Korean](https://huggingface.co/course/ko/chapter1/1) (WIP) | [`chapters/ko`](https://github.com/huggingface/course/tree/main/chapters/ko) | [@Doohae](https://github.com/Doohae), [@wonhyeongseo](https://github.com/wonhyeongseo), [@dlfrnaos19](https://github.com/dlfrnaos19), [@nsbg](https://github.com/nsbg) |
2222
| [Portuguese](https://huggingface.co/course/pt/chapter1/1) (WIP) | [`chapters/pt`](https://github.com/huggingface/course/tree/main/chapters/pt) | [@johnnv1](https://github.com/johnnv1), [@victorescosta](https://github.com/victorescosta), [@LincolnVS](https://github.com/LincolnVS) |
2323
| [Russian](https://huggingface.co/course/ru/chapter1/1) (WIP) | [`chapters/ru`](https://github.com/huggingface/course/tree/main/chapters/ru) | [@pdumin](https://github.com/pdumin), [@svv73](https://github.com/svv73), [@blademoon](https://github.com/blademoon) |
24+
| [Telugu]( https://huggingface.co/course/te/chapter0/1 ) (WIP) | [`chapters/te`](https://github.com/huggingface/course/tree/main/chapters/te) | [@Ajey95](https://github.com/Ajey95)
2425
| [Thai](https://huggingface.co/course/th/chapter1/1) (WIP) | [`chapters/th`](https://github.com/huggingface/course/tree/main/chapters/th) | [@peeraponw](https://github.com/peeraponw), [@a-krirk](https://github.com/a-krirk), [@jomariya23156](https://github.com/jomariya23156), [@ckingkan](https://github.com/ckingkan) |
2526
| [Turkish](https://huggingface.co/course/tr/chapter1/1) (WIP) | [`chapters/tr`](https://github.com/huggingface/course/tree/main/chapters/tr) | [@tanersekmen](https://github.com/tanersekmen), [@mertbozkir](https://github.com/mertbozkir), [@ftarlaci](https://github.com/ftarlaci), [@akkasayaz](https://github.com/akkasayaz) |
2627
| [Vietnamese](https://huggingface.co/course/vi/chapter1/1) | [`chapters/vi`](https://github.com/huggingface/course/tree/main/chapters/vi) | [@honghanhh](https://github.com/honghanhh) |
2728
| [Chinese (simplified)](https://huggingface.co/course/zh-CN/chapter1/1) | [`chapters/zh-CN`](https://github.com/huggingface/course/tree/main/chapters/zh-CN) | [@zhlhyx](https://github.com/zhlhyx), [petrichor1122](https://github.com/petrichor1122), [@1375626371](https://github.com/1375626371) |
2829
| [Chinese (traditional)](https://huggingface.co/course/zh-TW/chapter1/1) (WIP) | [`chapters/zh-TW`](https://github.com/huggingface/course/tree/main/chapters/zh-TW) | [@davidpeng86](https://github.com/davidpeng86) |
29-
30+
| [Romanian](https://huggingface.co/course/rum/chapter1/1) (WIP) | [`chapters/rum`](https://github.com/huggingface/course/tree/main/chapters/rum) | [@Sigmoid](https://github.com/SigmoidAI), [@eduard-balamatiuc](https://github.com/eduard-balamatiuc), [@FriptuLudmila](https://github.com/FriptuLudmila), [@tokyo-s](https://github.com/tokyo-s), [@hbkdesign](https://github.com/hbkdesign), [@grumpycatyo-collab](https://github.com/grumpycatyo-collab), [@Angroys](https://github.com/Angroys) |
3031

3132
### Translating the course into your language
3233

@@ -110,7 +111,7 @@ pip install -r requirements.txt
110111
make style
111112
```
112113
113-
Once that's run, commit any changes, open a pull request, and tag [@lewtun](https://github.com/lewtun) for a review. Congratulations, you've now completed your first translation 🥳!
114+
Once that's run, commit any changes, open a pull request, and tag [@lewtun](https://github.com/lewtun) and [@stevhliu](https://github.com/stevhliu) for a review. If you also know other native-language speakers who are able to review the translation, tag them as well for help. Congratulations, you've now completed your first translation 🥳!
114115
115116
> 🚨 To build the course on the website, double-check your language code exists in `languages` field of the `build_documentation.yml` and `build_pr_documentation.yml` files in the `.github` folder. If not, just add them in their alphabetical order.
116117
@@ -144,6 +145,25 @@ If you get stuck, check out one of the existing chapters -- this will often show
144145

145146
Once you are happy with the content, open a pull request and tag [@lewtun](https://github.com/lewtun) for a review. We recommend adding the first chapter draft as a single pull request -- the team will then provide feedback internally to iterate on the content 🤗!
146147

148+
## Deploying to hf.co/course (for HF staff)
149+
150+
The course content is deployed to [hf.co/course](https://huggingface.co/learn/nlp-course/chapter1/1) by triggering the [GitHub CI](.github/workflows/build_documentation.yml) from the `release` branch. To trigger the build, first create a new branch from `main` that will be used to update the current state on `release`:
151+
152+
```shell
153+
git checkout main
154+
git checkout -b bump_release
155+
```
156+
157+
Next, resolve any conflicts between the `release` and `bump_release` branches. Since this is tiresome to do manually, we can do the following to accept the latest changes:
158+
159+
```shell
160+
git checkout bump_release
161+
git merge -s ours release
162+
```
163+
164+
Next, push the `bump_release` branch and open a PR against `release` (not `main`!). Here is an example [PR](https://github.com/huggingface/course/pull/768). Once the CI is green, merge the PR and this will trigger the GitHub CI to build the new course content. This takes around 10-15 minutes, after which the latest changes will be visible on [hf.co/course](https://huggingface.co/learn/nlp-course/chapter1/1)!
165+
166+
147167
## 🙌 Acknowledgements
148168

149169
The structure of this repo and README are inspired by the wonderful [Advanced NLP with spaCy](https://github.com/ines/spacy-course) course.

chapters/de/chapter3/2.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ Wir fahren mit dem Beispiel aus dem [vorigen Kapitel](/course/chapter2) fort. Fo
2727

2828
```python
2929
import torch
30-
from transformers import AdamW, AutoTokenizer, AutoModelForSequenceClassification
30+
from torch.optim import AdamW
31+
from transformers import AutoTokenizer, AutoModelForSequenceClassification
3132

3233
# Genau wie vorher
3334
checkpoint = "bert-base-uncased"

chapters/de/chapter3/4.mdx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Alle 🤗 Transformer Modelle geben den Verlust zurück, wenn `labels` angegeben
105105
Wir sind fast so weit, unsere Trainingsschleife zu schreiben! Es fehlen nur noch zwei Dinge: ein Optimierer und ein Scheduler für die Lernrate. Da wir versuchen, das zu wiederholen, was der `Trainer` automatisch gemacht hat, werden wir die gleichen Standardwerte verwenden. Der Optimierer, den der `Trainer` verwendet, heißt "AdamW" und ist größtenteils derselbe wie Adam, abgesehen von einer Abwandlung für die "Weight Decay Regularization" (siehe ["Decoupled Weight Decay Regularization"] (https://arxiv.org/abs/1711.05101) von Ilya Loshchilov und Frank Hutter):
106106

107107
```py
108-
from transformers import AdamW
108+
from torch.optim import AdamW
109109

110110
optimizer = AdamW(model.parameters(), lr=5e-5)
111111
```
@@ -209,7 +209,8 @@ Auch hier werden deine Ergebnisse wegen der Zufälligkeit bei der Initialisierun
209209
Die Trainingsschleife, die wir zuvor definiert haben, funktioniert gut auf einer einzelnen CPU oder GPU. Aber mit der Bibliothek [🤗 Accelerate](https://github.com/huggingface/accelerate) können wir mit wenigen Anpassungen verteiltes Training auf mehreren GPUs oder TPUs implementieren. Beginnend mit der Erstellung der Trainings- und Validierungsdaten, sieht unsere manuelle Trainingsschleife nun folgendermaßen aus:
210210

211211
```py
212-
from transformers import AdamW, AutoModelForSequenceClassification, get_scheduler
212+
from torch.optim import AdamW
213+
from transformers import AutoModelForSequenceClassification, get_scheduler
213214

214215
model = AutoModelForSequenceClassification.from_pretrained(checkpoint, num_labels=2)
215216
optimizer = AdamW(model.parameters(), lr=3e-5)
@@ -246,7 +247,8 @@ Und hier sind die Änderungen:
246247

247248
```diff
248249
+ from accelerate import Accelerator
249-
from transformers import AdamW, AutoModelForSequenceClassification, get_scheduler
250+
from torch.optim import AdamW
251+
from transformers import AutoModelForSequenceClassification, get_scheduler
250252

251253
+ accelerator = Accelerator()
252254

@@ -298,7 +300,8 @@ Wenn du damit experimentieren möchtest, siehst du hier, wie die komplette Train
298300

299301
```py
300302
from accelerate import Accelerator
301-
from transformers import AdamW, AutoModelForSequenceClassification, get_scheduler
303+
from torch.optim import AdamW
304+
from transformers import AutoModelForSequenceClassification, get_scheduler
302305

303306
accelerator = Accelerator()
304307

chapters/en/_toctree.yml

Lines changed: 77 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,25 @@
88
- local: chapter1/1
99
title: Introduction
1010
- local: chapter1/2
11-
title: Natural Language Processing
11+
title: Natural Language Processing and Large Language Models
1212
- local: chapter1/3
1313
title: Transformers, what can they do?
1414
- local: chapter1/4
1515
title: How do Transformers work?
1616
- local: chapter1/5
17-
title: Encoder models
17+
title: How 🤗 Transformers solve tasks
1818
- local: chapter1/6
19-
title: Decoder models
19+
title: Transformer Architectures
2020
- local: chapter1/7
21-
title: Sequence-to-sequence models
21+
title: Quick quiz
2222
- local: chapter1/8
23-
title: Bias and limitations
23+
title: Inference with LLMs
2424
- local: chapter1/9
25-
title: Summary
25+
title: Bias and limitations
2626
- local: chapter1/10
27-
title: End-of-chapter quiz
27+
title: Summary
28+
- local: chapter1/11
29+
title: Certification exam
2830
quiz: 1
2931

3032
- title: 2. Using 🤗 Transformers
@@ -44,6 +46,8 @@
4446
- local: chapter2/7
4547
title: Basic usage completed!
4648
- local: chapter2/8
49+
title: Optimized Inference Deployment
50+
- local: chapter2/9
4751
title: End-of-chapter quiz
4852
quiz: 2
4953

@@ -54,13 +58,14 @@
5458
- local: chapter3/2
5559
title: Processing the data
5660
- local: chapter3/3
57-
title: Fine-tuning a model with the Trainer API or Keras
58-
local_fw: { pt: chapter3/3, tf: chapter3/3_tf }
61+
title: Fine-tuning a model with the Trainer API
5962
- local: chapter3/4
60-
title: A full training
63+
title: A full training loop
6164
- local: chapter3/5
62-
title: Fine-tuning, Check!
65+
title: Understanding Learning Curves
6366
- local: chapter3/6
67+
title: Fine-tuning, Check!
68+
- local: chapter3/7
6469
title: End-of-chapter quiz
6570
quiz: 3
6671

@@ -126,7 +131,7 @@
126131
title: End-of-chapter quiz
127132
quiz: 6
128133

129-
- title: 7. Main NLP tasks
134+
- title: 7. Classical NLP tasks
130135
sections:
131136
- local: chapter7/1
132137
title: Introduction
@@ -143,7 +148,7 @@
143148
- local: chapter7/7
144149
title: Question answering
145150
- local: chapter7/8
146-
title: Mastering NLP
151+
title: Mastering LLMs
147152
- local: chapter7/9
148153
title: End-of-chapter quiz
149154
quiz: 7
@@ -168,7 +173,6 @@
168173
quiz: 8
169174

170175
- title: 9. Building and sharing demos
171-
new: true
172176
subtitle: I trained a model, but how can I show it off?
173177
sections:
174178
- local: chapter9/1
@@ -191,6 +195,65 @@
191195
title: End-of-chapter quiz
192196
quiz: 9
193197

198+
- title: 10. Curate high-quality datasets
199+
subtitle: How to use Argilla to create amazing datasets
200+
sections:
201+
- local: chapter10/1
202+
title: Introduction to Argilla
203+
- local: chapter10/2
204+
title: Set up your Argilla instance
205+
- local: chapter10/3
206+
title: Load your dataset to Argilla
207+
- local: chapter10/4
208+
title: Annotate your dataset
209+
- local: chapter10/5
210+
title: Use your annotated dataset
211+
- local: chapter10/6
212+
title: Argilla, check!
213+
- local: chapter10/7
214+
title: End-of-chapter quiz
215+
quiz: 10
216+
217+
- title: 11. Fine-tune Large Language Models
218+
subtitle: Use Supervised Fine-tuning and Low-Rank Adaptation to fine-tune a large language model
219+
sections:
220+
- local: chapter11/1
221+
title: Introduction
222+
- local: chapter11/2
223+
title: Chat Templates
224+
- local: chapter11/3
225+
title: Fine-Tuning with SFTTrainer
226+
- local: chapter11/4
227+
title: LoRA (Low-Rank Adaptation)
228+
- local: chapter11/5
229+
title: Evaluation
230+
- local: chapter11/6
231+
title: Conclusion
232+
- local: chapter11/7
233+
title: Exam Time!
234+
quiz: 11
235+
236+
- title: 12. Build Reasoning Models
237+
subtitle: Learn how to build reasoning models like DeepSeek R1
238+
new: true
239+
sections:
240+
- local: chapter12/1
241+
title: Introduction
242+
- local: chapter12/2
243+
title: Reinforcement Learning on LLMs
244+
- local: chapter12/3
245+
title: The Aha Moment in the DeepSeek R1 Paper
246+
- local: chapter12/3a
247+
title: Advanced Understanding of GRPO in DeepSeekMath
248+
- local: chapter12/4
249+
title: Implementing GRPO in TRL
250+
- local: chapter12/5
251+
title: Practical Exercise to Fine-tune a model with GRPO
252+
- local: chapter12/6
253+
title: Practical Exercise with Unsloth
254+
- local: chapter12/7
255+
title: Coming soon...
256+
194257
- title: Course Events
195258
sections:
196259
- local: events/1

0 commit comments

Comments
 (0)