# 🤗 Transformers 笔记本

您可以在这里找到 Hugging Face 提供的官方笔记本列表。

此外，我们还想在此列出由社区创作的有趣内容。如果您编写了利用 🤗 Transformers 的笔记本并希望在此展示，请提交一个 Pull Request，以便将其收录到 Community notebooks 部分。

## Hugging Face 的笔记本 🤗

### 文档笔记本

您可以将文档中的任意页面作为 Colab 中的 notebook 打开（相关页面上直接提供了按钮），如果您需要，它们也列在这里：

| Notebook     |      描述      |   |   |   |
|:----------|:-------------|:-------------|:------------|------:|
| [库快速入门](https://github.com/huggingface/notebooks/blob/main/transformers_doc/en/quicktour.ipynb)  | Transformers 中各种 API 的介绍 |[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/quicktour.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/en/transformers_doc/quicktour.ipynb)| |
| [任务概述](https://github.com/huggingface/notebooks/blob/main/transformers_doc/en/task_summary.ipynb)  | 如何按任务运行 Transformers 库中的模型 |[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/task_summary.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/task_summary.ipynb)| |
| [预处理数据](https://github.com/huggingface/notebooks/blob/main/transformers_doc/en/preprocessing.ipynb)  | 如何使用分词器对数据进行预处理 |[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/preprocessing.ipynb) | [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/preprocessing.ipynb)||
| [微调预训练模型](https://github.com/huggingface/notebooks/blob/main/transformers_doc/en/training.ipynb)  | 如何使用 Trainer 对预训练模型进行微调 |[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/training.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/training.ipynb)|[![Open in AMD Dev Cloud](https://oneclickamd.ai/static/amd.svg?v=2)](https://oneclickamd.ai/github/huggingface/notebooks/blob/main/transformers_doc/en/training.ipynb)|
| [分词器概览](https://github.com/huggingface/notebooks/blob/main/transformers_doc/en/tokenizer_summary.ipynb)  | 分词器算法之间的差异 |[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/tokenizer_summary.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/tokenizer_summary.ipynb)|[![Open in AMD Dev Cloud](https://oneclickamd.ai/static/amd.svg?v=2)](https://oneclickamd.ai/github/huggingface/notebooks/blob/main/transformers_doc/en/tokenizer_summary.ipynb )|
| [多语言模型](https://github.com/huggingface/notebooks/blob/main/transformers_doc/en/multilingual.ipynb)  | 如何使用该库的多语言模型 |[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/multilingual.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/multilingual.ipynb)|[![Open in AMD Dev Cloud](https://oneclickamd.ai/static/amd.svg?v=2)](https://oneclickamd.ai/github/huggingface/notebooks/blob/main/transformers_doc/en/multilingual.ipynb)|

### PyTorch 示例

#### 自然语言处理[[pytorch-nlp]]

| Notebook     |      描述      |   |   |   |
|:----------|:-------------|:-------------|:-------------|------:|
| [训练你的分词器](https://github.com/huggingface/notebooks/blob/main/examples/tokenizer_training.ipynb)  | 如何训练和使用您自己的分词器  |[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/tokenizer_training.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/tokenizer_training.ipynb)|[![Open in AMD Dev Cloud](https://oneclickamd.ai/static/amd.svg?v=2)](https://oneclickamd.ai/github/huggingface/notebooks/blob/main/examples/tokenizer_training.ipynb)|
| [训练你的语言模型](https://github.com/huggingface/notebooks/blob/main/examples/language_modeling_from_scratch.ipynb)   | 如何轻松开始使用 transformers  |[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling_from_scratch.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/language_modeling_from_scratch.ipynb)|[![Open in AMD Dev Cloud](https://oneclickamd.ai/static/amd.svg?v=2)](https://oneclickamd.ai/github/huggingface/notebooks/blob/main/examples/language_modeling_from_scratch.ipynb)|
| [如何在文本分类任务上微调模型](https://github.com/huggingface/notebooks/blob/main/examples/text_classification.ipynb)| 展示如何对数据进行预处理，并在任意 GLUE 任务上微调预训练模型。 | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/text_classification.ipynb)| |
| [如何在语言建模上微调模型](https://github.com/huggingface/notebooks/blob/main/examples/language_modeling.ipynb)| 展示如何对数据进行预处理，并在因果语言建模或掩码语言建模任务上微调预训练模型。 | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/language_modeling.ipynb)| [![Open in AMD Dev Cloud](https://oneclickamd.ai/static/amd.svg?v=2)](https://oneclickamd.ai/github/huggingface/notebooks/blob/main/examples/language_modeling.ipynb)|
| [如何在词元分类任务上微调模型](https://github.com/huggingface/notebooks/blob/main/examples/token_classification.ipynb)| 展示如何对数据进行预处理，并在命名实体识别（NER）和词性标注（PoS）等词元分类任务上微调预训练模型。 | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/token_classification.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/token_classification.ipynb)|[![Open in AMD Dev Cloud](https://oneclickamd.ai/static/amd.svg?v=2)](https://oneclickamd.ai/github/huggingface/notebooks/blob/main/examples/token_classification.ipynb)|
| [如何在问答任务上微调模型](https://github.com/huggingface/notebooks/blob/main/examples/question_answering.ipynb)| 展示如何对数据进行预处理，并在 SQUAD 上微调预训练模型。 | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/question_answering.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/question_answering.ipynb)|[![Open in AMD Dev Cloud](https://oneclickamd.ai/static/amd.svg?v=2)](https://oneclickamd.ai/github/huggingface/notebooks/blob/main/examples/question_answering.ipynb)|
| [如何在多选题上微调模型](https://github.com/huggingface/notebooks/blob/main/examples/multiple_choice.ipynb)| 展示如何对数据进行预处理，并在 SWAG 上微调预训练模型。 | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/multiple_choice.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/multiple_choice.ipynb)|[![Open in AMD Dev Cloud](https://oneclickamd.ai/static/amd.svg?v=2)](https://oneclickamd.ai/github/huggingface/notebooks/blob/main/examples/multiple_choice.ipynb)|
| [如何在翻译任务上微调模型](https://github.com/huggingface/notebooks/blob/main/examples/translation.ipynb)| 展示如何对数据进行预处理，并在 WMT 上微调预训练模型。 | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/translation.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/translation.ipynb)|[![Open in AMD Dev Cloud](https://oneclickamd.ai/static/amd.svg?v=2)](https://oneclickamd.ai/github/huggingface/notebooks/blob/main/examples/translation.ipynb)|
| [如何在摘要任务上微调模型](https://github.com/huggingface/notebooks/blob/main/examples/summarization.ipynb)| 展示如何对数据进行预处理，并在 XSUM 上微调一个预训练模型。 | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/summarization.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/summarization.ipynb)| |
| [如何从零开始训练语言模型](https://github.com/huggingface/blog/blob/main/notebooks/01_how_to_train.ipynb)| 突出显示在自定义数据上有效训练 Transformer 模型的所有步骤 | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/blog/blob/main/notebooks/01_how_to_train.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/blog/blob/main/notebooks/01_how_to_train.ipynb)| |
| [如何生成文本](https://github.com/huggingface/blog/blob/main/notebooks/02_how_to_generate.ipynb)| 如何使用 transformers 的不同解码方法进行语言生成 | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/blog/blob/main/notebooks/02_how_to_generate.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/blog/blob/main/notebooks/02_how_to_generate.ipynb)| |
| [Reformer](https://github.com/huggingface/blog/blob/main/notebooks/03_reformer.ipynb)| Reformer 如何突破语言建模的极限 | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/patrickvonplaten/blog/blob/main/notebooks/03_reformer.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/patrickvonplaten/blog/blob/main/notebooks/03_reformer.ipynb)| |

#### 计算机视觉[[pytorch-cv]]

| Notebook                                                                                                                                                                   | 描述                                                                                                            |                                                                                                                                                                                                            |   |   |
|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:------|------:|
| [如何在图像分类上微调模型（Torchvision）](https://github.com/huggingface/notebooks/blob/main/examples/image_classification.ipynb)                   | 展示如何使用 Torchvision 对数据进行预处理，并在图像分类任务上微调任意预训练的视觉模型    | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb)                 | [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb)| [![Open in AMD Dev Cloud](https://oneclickamd.ai/static/amd.svg?v=2)](https://oneclickamd.ai/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb)|
| [如何在图像分类任务上微调模型（Albumentations）](https://github.com/huggingface/notebooks/blob/main/examples/image_classification_albumentations.ipynb) | 展示如何使用 Albumentations 对数据进行预处理，并在图像分类任务上微调任意预训练的 Vision 模型 | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification_albumentations.ipynb)  | [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/image_classification_albumentations.ipynb)| |
| [如何在图像分类任务上微调模型（Kornia）](https://github.com/huggingface/notebooks/blob/main/examples/image_classification_kornia.ipynb)                 | 展示如何使用 Kornia 对数据进行预处理，并在图像分类任务上微调任意预训练的视觉模型         | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification_kornia.ipynb)          | [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/image_classification_kornia.ipynb)| |
| [如何使用 OWL-ViT 执行零样本目标检测](https://github.com/huggingface/notebooks/blob/main/examples/zeroshot_object_detection_with_owlvit.ipynb)          | 展示如何使用文本查询在图像上执行零样本目标检测                                             | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/zeroshot_object_detection_with_owlvit.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/zeroshot_object_detection_with_owlvit.ipynb)| |
| [如何微调图像描述模型](https://github.com/huggingface/notebooks/blob/main/examples/image_captioning_blip.ipynb)                                      | 展示如何在自定义数据集上微调 BLIP 以进行图像描述                                                    | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_captioning_blip.ipynb)                | [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/image_captioning_blip.ipynb)| |
| [如何使用 Transformers 构建图像相似度系统](https://github.com/huggingface/notebooks/blob/main/examples/image_similarity.ipynb)                            | 展示如何构建一个图像相似度系统                                                                           | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_similarity.ipynb)                     | [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/image_similarity.ipynb)| |
| [如何在语义分割任务上微调 SegFormer 模型](https://github.com/huggingface/notebooks/blob/main/examples/semantic_segmentation.ipynb)                     | 展示如何预处理数据，并在语义分割任务上微调预训练的 SegFormer 模型                    | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/semantic_segmentation.ipynb)                | [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/semantic_segmentation.ipynb)| |
| [如何在视频分类任务上微调 VideoMAE 模型](https://github.com/huggingface/notebooks/blob/main/examples/video_classification.ipynb)          | 展示如何对数据进行预处理，并在视频分类任务上微调预训练的 VideoMAE 模型                      | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/video_classification.ipynb)                | [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/video_classification.ipynb)| |

#### 音频[[pytorch-audio]]

| Notebook     |      描述      |   |   |
|:----------|:-------------|:-------------|------:|
| [如何微调英语语音识别模型](https://github.com/huggingface/notebooks/blob/main/examples/speech_recognition.ipynb)| 展示如何对数据进行预处理，并在 TIMIT 上微调一个预训练的 Speech 模型 | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/speech_recognition.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/speech_recognition.ipynb)|
| [如何微调任意语言的语音识别模型](https://github.com/huggingface/notebooks/blob/main/examples/multi_lingual_speech_recognition.ipynb)| 展示如何对数据进行预处理，并在 Common Voice 上微调一个多语言预训练的语音模型 | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/multi_lingual_speech_recognition.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/multi_lingual_speech_recognition.ipynb)|
| [如何在音频分类任务上微调模型](https://github.com/huggingface/notebooks/blob/main/examples/audio_classification.ipynb)| 展示如何对数据进行预处理，并在关键词检测任务上微调预训练的 Speech 模型 | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/audio_classification.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/audio_classification.ipynb)|

#### 生物序列[[pytorch-bio]]

| Notebook     | 描述                                                                             |   |   |
|:----------|:----------------------------------------------------------------------------------------|:-------------|------:|
| [如何微调预训练蛋白质模型](https://github.com/huggingface/notebooks/blob/main/examples/protein_language_modeling.ipynb) | 了解如何对蛋白质进行分词，并微调大型预训练蛋白质“语言”模型 | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/protein_language_modeling.ipynb) | [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/protein_language_modeling.ipynb) |
| [如何生成蛋白质折叠](https://github.com/huggingface/notebooks/blob/main/examples/protein_folding.ipynb) | 了解如何从蛋白质序列生成完整的蛋白质模型和 PDB 文件                | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/protein_folding.ipynb) | [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/protein_folding.ipynb) |
| [如何微调 Nucleotide Transformer 模型](https://github.com/huggingface/notebooks/blob/main/examples/nucleotide_transformer_dna_sequence_modelling.ipynb) | 了解如何对 DNA 进行分词，并微调一个大型预训练 DNA“语言”模型 | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/nucleotide_transformer_dna_sequence_modelling.ipynb) | [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/nucleotide_transformer_dna_sequence_modelling.ipynb) |
| [使用 LoRA 微调 Nucleotide Transformer 模型](https://github.com/huggingface/notebooks/blob/main/examples/nucleotide_transformer_dna_sequence_modelling_with_peft.ipynb) | 以内存高效的方式训练更大的 DNA 模型 | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/nucleotide_transformer_dna_sequence_modelling_with_peft.ipynb) | [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/nucleotide_transformer_dna_sequence_modelling_with_peft.ipynb) |

#### 其他模态[[pytorch-other]]

| Notebook     | 描述                                                                             |   |   |
|:----------|:----------------------------------------------------------------------------------------|:-------------|------:|
| [概率时间序列预测](https://github.com/huggingface/notebooks/blob/main/examples/time-series-transformers.ipynb) | 查看如何在自定义数据集上训练 Time Series Transformer                            | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/time-series-transformers.ipynb) | [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/time-series-transformers.ipynb) |

#### 实用笔记本[[pytorch-utility]]

| Notebook     |      描述      |   |   |
|:----------|:-------------|:-------------|------:|
| [如何将模型导出为 ONNX](https://github.com/huggingface/notebooks/blob/main/examples/onnx-export.ipynb)| 突出介绍如何通过 ONNX 导出并运行推理工作负载 | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/onnx-export.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/onnx-export.ipynb)|

### Optimum 笔记本

🤗  [Optimum](https://github.com/huggingface/optimum) 是 🤗 Transformers 的扩展，提供了一组性能优化工具，可在目标硬件上以最高效率训练和运行模型。

| Notebook     |      描述      |   |   |
|:----------|:-------------|:-------------|------:|
| [如何使用 ONNX Runtime 对文本分类模型进行量化](https://github.com/huggingface/notebooks/blob/main/examples/text_classification_quantization_ort.ipynb)| 展示如何使用 [ONNX Runtime](https://github.com/microsoft/onnxruntime) 对任意 GLUE 任务中的模型应用静态量化和动态量化。 | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification_quantization_ort.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/text_classification_quantization_ort.ipynb)|
| [如何使用 ONNX Runtime 对文本分类模型进行微调](https://github.com/huggingface/notebooks/blob/main/examples/text_classification_ort.ipynb)| 展示如何使用 [ONNX Runtime](https://github.com/microsoft/onnxruntime) 对数据进行预处理，并在任意 GLUE 任务上微调模型。 | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification_ort.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/text_classification_ort.ipynb)|
| [如何使用 ONNX Runtime 对模型进行摘要任务微调](https://github.com/huggingface/notebooks/blob/main/examples/summarization_ort.ipynb)| 展示如何使用 [ONNX Runtime](https://github.com/microsoft/onnxruntime) 对数据进行预处理，并在 XSUM 上微调模型。 | [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/summarization_ort.ipynb)| [![Open in AWS Studio](https://studiolab.sagemaker.aws/studiolab.svg)](https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/summarization_ort.ipynb)|

## 社区笔记本

社区开发的更多笔记本可在[此处](https://hf.co/docs/transformers/community#community-notebooks)获取。

