<meta charset="utf-8" /><meta http-equiv="content-security-policy" content=""><meta name="hf:doc:metadata" content="{&quot;local&quot;:&quot;transformers-notebooks&quot;,&quot;sections&quot;:[{&quot;local&quot;:&quot;hugging-faces-notebooks&quot;,&quot;sections&quot;:[{&quot;local&quot;:&quot;documentation-notebooks&quot;,&quot;title&quot;:&quot;Documentation notebooks&quot;},{&quot;local&quot;:&quot;pytorch-examples&quot;,&quot;title&quot;:&quot;PyTorch Examples&quot;},{&quot;local&quot;:&quot;tensorflow-examples&quot;,&quot;title&quot;:&quot;TensorFlow Examples&quot;},{&quot;local&quot;:&quot;optimum-notebooks&quot;,&quot;title&quot;:&quot;Optimum notebooks&quot;}],&quot;title&quot;:&quot;Hugging Face&#39;s notebooks 🤗&quot;},{&quot;local&quot;:&quot;community-notebooks&quot;,&quot;title&quot;:&quot;Community notebooks:&quot;}],&quot;title&quot;:&quot;🤗 Transformers Notebooks&quot;}" data-svelte="svelte-1phssyn">
	<link rel="modulepreload" href="/docs/transformers/pr_17170/en/_app/assets/pages/__layout.svelte-659a8e1b.css">
	<link rel="modulepreload" href="/docs/transformers/pr_17170/en/_app/start-7b834ccc.js">
	<link rel="modulepreload" href="/docs/transformers/pr_17170/en/_app/chunks/vendor-6b77c823.js">
	<link rel="modulepreload" href="/docs/transformers/pr_17170/en/_app/chunks/paths-4b3c6e7e.js">
	<link rel="modulepreload" href="/docs/transformers/pr_17170/en/_app/pages/__layout.svelte-3f22c1e5.js">
	<link rel="modulepreload" href="/docs/transformers/pr_17170/en/_app/pages/notebooks.mdx-355f7aa2.js">
	<link rel="modulepreload" href="/docs/transformers/pr_17170/en/_app/chunks/IconCopyLink-7a11ce68.js"> 






<h1 class="relative group"><a id="transformers-notebooks" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#transformers-notebooks"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a>
	<span>🤗 Transformers Notebooks
	</span></h1>

<p>You can find here a list of the official notebooks provided by Hugging Face.</p>
<p>Also, we would like to list here interesting content created by the community.
If you wrote some notebook(s) leveraging 🤗 Transformers and would like be listed here, please open a
Pull Request so it can be included under the Community notebooks. </p>
<h2 class="relative group"><a id="hugging-faces-notebooks" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#hugging-faces-notebooks"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a>
	<span>Hugging Face&#39;s notebooks 🤗
	</span></h2>

<h3 class="relative group"><a id="documentation-notebooks" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#documentation-notebooks"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a>
	<span>Documentation notebooks
	</span></h3>

<p>You can open any page of the documentation as a notebook in colab (there is a button directly on said pages) but they are also listed here if you need to:</p>
<table><thead><tr><th align="left">Notebook</th>
<th align="left">Description</th>
<th align="left"></th>
<th align="right"></th></tr></thead>
<tbody><tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/transformers_doc/en/quicktour.ipynb" rel="nofollow">Quicktour of the library</a></td>
<td align="left">A presentation of the various APIs in Transformers</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/quicktour.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/en/transformers_doc/quicktour.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/transformers_doc/en/task_summary.ipynb" rel="nofollow">Summary of the tasks</a></td>
<td align="left">How to run the models of the Transformers library task by task</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/task_summary.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/task_summary.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/transformers_doc/en/preprocessing.ipynb" rel="nofollow">Preprocessing data</a></td>
<td align="left">How to use a tokenizer to preprocess your data</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/preprocessing.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/preprocessing.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/transformers_doc/en/training.ipynb" rel="nofollow">Fine-tuning a pretrained model</a></td>
<td align="left">How to use the Trainer to fine-tune a pretrained model</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/training.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/training.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/transformers_doc/en/tokenizer_summary.ipynb" rel="nofollow">Summary of the tokenizers</a></td>
<td align="left">The differences between the tokenizers algorithm</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/tokenizer_summary.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/tokenizer_summary.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/transformers_doc/en/multilingual.ipynb" rel="nofollow">Multilingual models</a></td>
<td align="left">How to use the multilingual models of the library</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/transformers_doc/en/multilingual.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/transformers_doc/en/multilingual.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr></tbody></table>
<h3 class="relative group"><a id="pytorch-examples" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#pytorch-examples"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a>
	<span>PyTorch Examples
	</span></h3>

<table><thead><tr><th align="left">Notebook</th>
<th align="left">Description</th>
<th align="left"></th>
<th align="right"></th></tr></thead>
<tbody><tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/tokenizer_training.ipynb" rel="nofollow">Train your tokenizer</a></td>
<td align="left">How to train and use your very own tokenizer</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/tokenizer_training.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/tokenizer_training.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/language_modeling_from_scratch.ipynb" rel="nofollow">Train your language model</a></td>
<td align="left">How to easily start using transformers</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling_from_scratch.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/language_modeling_from_scratch.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/text_classification.ipynb" rel="nofollow">How to fine-tune a model on text classification</a></td>
<td align="left">Show how to preprocess the data and fine-tune a pretrained model on any GLUE task.</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/text_classification.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/language_modeling.ipynb" rel="nofollow">How to fine-tune a model on language modeling</a></td>
<td align="left">Show how to preprocess the data and fine-tune a pretrained model on a causal or masked LM task.</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/language_modeling.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/token_classification.ipynb" rel="nofollow">How to fine-tune a model on token classification</a></td>
<td align="left">Show how to preprocess the data and fine-tune a pretrained model on a token classification task (NER, PoS).</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/token_classification.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/token_classification.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/question_answering.ipynb" rel="nofollow">How to fine-tune a model on question answering</a></td>
<td align="left">Show how to preprocess the data and fine-tune a pretrained model on SQUAD.</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/question_answering.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/question_answering.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/multiple_choice.ipynb" rel="nofollow">How to fine-tune a model on multiple choice</a></td>
<td align="left">Show how to preprocess the data and fine-tune a pretrained model on SWAG.</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/multiple_choice.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/multiple_choice.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/translation.ipynb" rel="nofollow">How to fine-tune a model on translation</a></td>
<td align="left">Show how to preprocess the data and fine-tune a pretrained model on WMT.</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/translation.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/translation.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/summarization.ipynb" rel="nofollow">How to fine-tune a model on summarization</a></td>
<td align="left">Show how to preprocess the data and fine-tune a pretrained model on XSUM.</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/summarization.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/summarization.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/speech_recognition.ipynb" rel="nofollow">How to fine-tune a speech recognition model in English</a></td>
<td align="left">Show how to preprocess the data and fine-tune a pretrained Speech model on TIMIT</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/speech_recognition.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/speech_recognition.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/multi_lingual_speech_recognition.ipynb" rel="nofollow">How to fine-tune a speech recognition model in any language</a></td>
<td align="left">Show how to preprocess the data and fine-tune a multi-lingually pretrained speech model on Common Voice</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/multi_lingual_speech_recognition.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/multi_lingual_speech_recognition.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/audio_classification.ipynb" rel="nofollow">How to fine-tune a model on audio classification</a></td>
<td align="left">Show how to preprocess the data and fine-tune a pretrained Speech model on Keyword Spotting</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/audio_classification.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/audio_classification.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/blog/blob/main/notebooks/01_how_to_train.ipynb" rel="nofollow">How to train a language model from scratch</a></td>
<td align="left">Highlight all the steps to effectively train Transformer model on custom data</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/blog/blob/main/notebooks/01_how_to_train.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/blog/blob/main/notebooks/01_how_to_train.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/blog/blob/main/notebooks/02_how_to_generate.ipynb" rel="nofollow">How to generate text</a></td>
<td align="left">How to use different decoding methods for language generation with transformers</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/blog/blob/main/notebooks/02_how_to_generate.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/blog/blob/main/notebooks/02_how_to_generate.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/blog/blob/main/notebooks/53_constrained_beam_search.ipynb" rel="nofollow">How to generate text (with constraints)</a></td>
<td align="left">How to guide language generation with user-provided constraints</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/blog/blob/main/notebooks/53_constrained_beam_search.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/blog/blob/main/notebooks/53_constrained_beam_search.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/onnx-export.ipynb" rel="nofollow">How to export model to ONNX</a></td>
<td align="left">Highlight how to export and run inference workloads through ONNX</td>
<td align="left"></td>
<td align="right"></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/benchmark.ipynb" rel="nofollow">How to use Benchmarks</a></td>
<td align="left">How to benchmark models with transformers</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/benchmark.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/benchmark.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/blog/blob/main/notebooks/03_reformer.ipynb" rel="nofollow">Reformer</a></td>
<td align="left">How Reformer pushes the limits of language modeling</td>
<td align="left"><a href="https://colab.research.google.com/github/patrickvonplaten/blog/blob/main/notebooks/03_reformer.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/patrickvonplaten/blog/blob/main/notebooks/03_reformer.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/image_classification.ipynb" rel="nofollow">How to fine-tune a model on image classification</a></td>
<td align="left">Show how to preprocess the data and fine-tune any pretrained Vision model on Image Classification</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/image_classification.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr></tbody></table>
<h3 class="relative group"><a id="tensorflow-examples" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorflow-examples"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a>
	<span>TensorFlow Examples
	</span></h3>

<table><thead><tr><th align="left">Notebook</th>
<th align="left">Description</th>
<th align="left"></th>
<th align="right"></th></tr></thead>
<tbody><tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/tokenizer_training.ipynb" rel="nofollow">Train your tokenizer</a></td>
<td align="left">How to train and use your very own tokenizer</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/tokenizer_training.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/tokenizer_training.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/language_modeling_from_scratch-tf.ipynb" rel="nofollow">Train your language model</a></td>
<td align="left">How to easily start using transformers</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling_from_scratch-tf.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/language_modeling_from_scratch-tf.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/text_classification-tf.ipynb" rel="nofollow">How to fine-tune a model on text classification</a></td>
<td align="left">Show how to preprocess the data and fine-tune a pretrained model on any GLUE task.</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification-tf.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/text_classification-tf.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/language_modeling-tf.ipynb" rel="nofollow">How to fine-tune a model on language modeling</a></td>
<td align="left">Show how to preprocess the data and fine-tune a pretrained model on a causal or masked LM task.</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/language_modeling-tf.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/language_modeling-tf.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/token_classification-tf.ipynb" rel="nofollow">How to fine-tune a model on token classification</a></td>
<td align="left">Show how to preprocess the data and fine-tune a pretrained model on a token classification task (NER, PoS).</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/token_classification-tf.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/token_classification-tf.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/question_answering-tf.ipynb" rel="nofollow">How to fine-tune a model on question answering</a></td>
<td align="left">Show how to preprocess the data and fine-tune a pretrained model on SQUAD.</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/question_answering-tf.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/question_answering-tf.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/multiple_choice-tf.ipynb" rel="nofollow">How to fine-tune a model on multiple choice</a></td>
<td align="left">Show how to preprocess the data and fine-tune a pretrained model on SWAG.</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/multiple_choice-tf.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/multiple_choice-tf.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/translation-tf.ipynb" rel="nofollow">How to fine-tune a model on translation</a></td>
<td align="left">Show how to preprocess the data and fine-tune a pretrained model on WMT.</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/translation-tf.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/translation-tf.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/summarization-tf.ipynb" rel="nofollow">How to fine-tune a model on summarization</a></td>
<td align="left">Show how to preprocess the data and fine-tune a pretrained model on XSUM.</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/summarization-tf.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/summarization-tf.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr></tbody></table>
<h3 class="relative group"><a id="optimum-notebooks" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#optimum-notebooks"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a>
	<span>Optimum notebooks
	</span></h3>

<p>🤗  <a href="https://github.com/huggingface/optimum" rel="nofollow">Optimum</a> is an extension of 🤗 Transformers, providing a set of performance optimization tools enabling maximum efficiency to train and run models on targeted hardwares.</p>
<table><thead><tr><th align="left">Notebook</th>
<th align="left">Description</th>
<th align="left"></th>
<th align="right"></th></tr></thead>
<tbody><tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/text_classification_quantization_ort.ipynb" rel="nofollow">How to quantize a model with ONNX Runtime for text classification</a></td>
<td align="left">Show how to apply static and dynamic quantization on a model using <a href="https://github.com/microsoft/onnxruntime" rel="nofollow">ONNX Runtime</a> for any GLUE task.</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification_quantization_ort.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/text_classification_quantization_ort.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr>
<tr><td align="left"><a href="https://github.com/huggingface/notebooks/blob/main/examples/text_classification_quantization_inc.ipynb" rel="nofollow">How to quantize a model with Intel Neural Compressor for text classification</a></td>
<td align="left">Show how to apply static, dynamic and aware training quantization on a model using <a href="https://github.com/intel/neural-compressor" rel="nofollow">Intel Neural Compressor (INC)</a> for any GLUE task.</td>
<td align="left"><a href="https://colab.research.google.com/github/huggingface/notebooks/blob/main/examples/text_classification_quantization_inc.ipynb" rel="nofollow"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open in Colab"></a></td>
<td align="right"><a href="https://studiolab.sagemaker.aws/import/github/huggingface/notebooks/blob/main/examples/text_classification_quantization_inc.ipynb" rel="nofollow"><img src="https://studiolab.sagemaker.aws/studiolab.svg" alt="Open in AWS Studio"></a></td></tr></tbody></table>
<h2 class="relative group"><a id="community-notebooks" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#community-notebooks"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a>
	<span>Community notebooks:
	</span></h2>

<p>More notebooks developed by the community are available <a href="community#community-notebooks">here</a>.</p>


		<script type="module" data-hydrate="idi9v">
		import { start } from "/docs/transformers/pr_17170/en/_app/start-7b834ccc.js";
		start({
			target: document.querySelector('[data-hydrate="idi9v"]').parentNode,
			paths: {"base":"/docs/transformers/pr_17170/en","assets":"/docs/transformers/pr_17170/en"},
			session: {},
			route: false,
			spa: false,
			trailing_slash: "never",
			hydrate: {
				status: 200,
				error: null,
				nodes: [
					import("/docs/transformers/pr_17170/en/_app/pages/__layout.svelte-3f22c1e5.js"),
						import("/docs/transformers/pr_17170/en/_app/pages/notebooks.mdx-355f7aa2.js")
				],
				params: {}
			}
		});
	</script>
