Back to Transformers

šŸ¤— Transformers Notebooks

notebooks/README.md

5.8.028.4 KB
Original Source
<!--- Copyright 2023 The HuggingFace Team. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->

šŸ¤— Transformers Notebooks

You can find here a list of the official notebooks provided by Hugging Face.

Also, we would like to list here interesting content created by the community. If you wrote some notebook(s) leveraging šŸ¤— Transformers and would like to be listed here, please open a Pull Request so it can be included under the Community notebooks.

Hugging Face's notebooks šŸ¤—

Documentation notebooks

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 them:

NotebookDescription
Quicktour of the libraryA presentation of the various APIs in Transformers
Summary of the tasksHow to run the models of the Transformers library task by task
Preprocessing dataHow to use a tokenizer to preprocess your data
Fine-tuning a pretrained modelHow to use the Trainer to fine-tune a pretrained model
Summary of the tokenizersThe differences between the tokenizers algorithm
Multilingual modelsHow to use the multilingual models of the library

PyTorch Examples

Natural Language Processing[[pytorch-nlp]]

NotebookDescription
Train your tokenizerHow to train and use your very own tokenizer
Train your language modelHow to easily start using transformers
How to fine-tune a model on text classificationShow how to preprocess the data and fine-tune a pretrained model on any GLUE task.
How to fine-tune a model on language modelingShow how to preprocess the data and fine-tune a pretrained model on a causal or masked LM task.
How to fine-tune a model on token classificationShow how to preprocess the data and fine-tune a pretrained model on a token classification task (NER, PoS).
How to fine-tune a model on question answeringShow how to preprocess the data and fine-tune a pretrained model on SQUAD.
How to fine-tune a model on multiple choiceShow how to preprocess the data and fine-tune a pretrained model on SWAG.
How to fine-tune a model on translationShow how to preprocess the data and fine-tune a pretrained model on WMT.
How to fine-tune a model on summarizationShow how to preprocess the data and fine-tune a pretrained model on XSUM.
How to train a language model from scratchHighlight all the steps to effectively train Transformer model on custom data
How to generate textHow to use different decoding methods for language generation with transformers
ReformerHow Reformer pushes the limits of language modeling

Computer Vision[[pytorch-cv]]

NotebookDescription
How to fine-tune a model on image classification (Torchvision)Show how to preprocess the data using Torchvision and fine-tune any pretrained Vision model on Image Classification
How to fine-tune a model on image classification (Albumentations)Show how to preprocess the data using Albumentations and fine-tune any pretrained Vision model on Image Classification
How to fine-tune a model on image classification (Kornia)Show how to preprocess the data using Kornia and fine-tune any pretrained Vision model on Image Classification
How to perform zero-shot object detection with OWL-ViTShow how to perform zero-shot object detection on images with text queries
How to fine-tune an image captioning modelShow how to fine-tune BLIP for image captioning on a custom dataset
How to build an image similarity system with TransformersShow how to build an image similarity system
How to fine-tune a SegFormer model on semantic segmentationShow how to preprocess the data and fine-tune a pretrained SegFormer model on Semantic Segmentation
How to fine-tune a VideoMAE model on video classificationShow how to preprocess the data and fine-tune a pretrained VideoMAE model on Video Classification

Audio[[pytorch-audio]]

NotebookDescription
How to fine-tune a speech recognition model in EnglishShow how to preprocess the data and fine-tune a pretrained Speech model on TIMIT
How to fine-tune a speech recognition model in any languageShow how to preprocess the data and fine-tune a multi-lingually pretrained speech model on Common Voice
How to fine-tune a model on audio classificationShow how to preprocess the data and fine-tune a pretrained Speech model on Keyword Spotting

Biological Sequences[[pytorch-bio]]

NotebookDescription
How to fine-tune a pre-trained protein modelSee how to tokenize proteins and fine-tune a large pre-trained protein "language" model
How to generate protein foldsSee how to go from protein sequence to a full protein model and PDB file
How to fine-tune a Nucleotide Transformer modelSee how to tokenize DNA and fine-tune a large pre-trained DNA "language" model
Fine-tune a Nucleotide Transformer model with LoRATrain even larger DNA models in a memory-efficient way

Other modalities[[pytorch-other]]

NotebookDescription
Probabilistic Time Series ForecastingSee how to train Time Series Transformer on a custom dataset

Utility notebooks[[pytorch-utility]]

NotebookDescription
How to export model to ONNXHighlight how to export and run inference workloads through ONNX

Optimum notebooks

šŸ¤— Optimum is an extension of šŸ¤— Transformers, providing a set of performance optimization tools enabling maximum efficiency to train and run models on targeted hardware.

NotebookDescription
How to quantize a model with ONNX Runtime for text classificationShow how to apply static and dynamic quantization on a model using ONNX Runtime for any GLUE task.
How to fine-tune a model on text classification with ONNX RuntimeShow how to preprocess the data and fine-tune a model on any GLUE task using ONNX Runtime.
How to fine-tune a model on summarization with ONNX RuntimeShow how to preprocess the data and fine-tune a model on XSUM using ONNX Runtime.

Community notebooks

More notebooks developed by the community are available here.