{ "cells": [ { "cell_type": "markdown", "id": "75b58048-7d14-4fc6-8085-1fc08c81b4a6", "metadata": {}, "source": [ "# Fine-Tune Whisper With πŸ€— Transformers and Streaming Mode" ] }, { "cell_type": "markdown", "id": "fbfa8ad5-4cdc-4512-9058-836cbbf65e1a", "metadata": {}, "source": [ "In this Colab, we present a step-by-step guide on fine-tuning Whisper with Hugging Face πŸ€— Transformers on 400 hours of speech data! Using streaming mode, we'll show how you can train a speech recongition model on any dataset, irrespective of size. With streaming mode, storage requirements are no longer a consideration: you can train a model on whatever dataset you want, even if it's download size exceeds your devices disk space. How can this be possible? It simply seems too good to be true! Well, rest assured it's not πŸ˜‰ Carry on reading to find out more." ] }, { "cell_type": "markdown", "id": "afe0d503-ae4e-4aa7-9af4-dbcba52db41e", "metadata": {}, "source": [ "## Introduction" ] }, { "cell_type": "markdown", "id": "9ae91ed4-9c3e-4ade-938e-f4c2dcfbfdc0", "metadata": {}, "source": [ "Speech recognition datasets are large. A typical speech dataset consists of approximately 100 hours of audio-transcription data, requiring upwards of 130GB of storage space for download and preparation. For most ASR researchers, this is already at the upper limit of what is feasible for disk space. So what happens when we want to train on a larger dataset? The full [LibriSpeech](https://huggingface.co/datasets/librispeech_asr) dataset consists of 960 hours of audio data. Kensho's [SPGISpeech](https://huggingface.co/datasets/kensho/spgispeech) contains 5,000 hours of audio data. ML Commons [People's Speech](https://huggingface.co/datasets/MLCommons/peoples_speech) contains **30,000+** hours of audio data! Do we need to bite the bullet and buy additional storage? Or is there a way we can train on all of these datasets with no disk drive requirements?\n", "\n", "When training machine learning systems, we rarely use the entire dataset at once. We typically _batch_ our data into smaller subsets of data, and pass these incrementally through our training pipeline. This is because we train our system on an accelerator device, such as a GPU or TPU, which has a memory limit typically around 16GB. We have to fit our model, optimiser and training data all on the same accelerator device, so we usually have to divide the dataset up into smaller batches and move them from the CPU to the GPU when required.\n", "\n", "Consequently, we don't require the entire dataset to be downloaded at once; we simply need the batch of data that we pass to our model at any one go. We can leverage this principle of partial dataset loading when preparing our dataset: rather than downloading the entire dataset at the start, we can load each piece of data as and when we need it. For each batch, we load the relevant data from a remote server and pass it through the training pipeline. For the next batch, we load the next items and again pass them through the training pipeline. At no point do we have to save data to our disk drive, we simply load them in memory and use them in our pipeline. In doing so, we only ever need as much memory as each individual batch requires.\n", "\n", "This is analogous to downloading a TV show versus streaming it πŸ“Ί When we download a TV show, we download the entire video offline and save it to our disk. Compare this to when we stream a TV show. Here, we don't download any part of the video to memory, but iterate over the video file and load each part in real-time as required. It's this same principle that we can apply to our ML training pipeline! We want to iterate over the dataset and load each sample of data as required.\n", "\n", "While the principle of partial dataset loading sounds ideal, it also seems **pretty** difficult to do. Luckily for us, πŸ€— Datasets allows us to do this with minimal code changes! We'll make use of the principle of [_streaming_](https://huggingface.co/docs/datasets/stream), depicted graphically in Figure 1. Streaming does exactly this: the data is loaded progressively as we iterate over the dataset, meaning it is only loaded as and when we need it. If you're familiar with πŸ€— Transformers and Datasets, the content of this notebook will be very familiar, with some small extensions to support streaming mode." ] }, { "cell_type": "markdown", "id": "1c87f76e-47be-4a5d-bc52-7b1c2e9d4f5a", "metadata": {}, "source": [ "
\n", "\"Trulli\"\n", "
Figure 1: Streaming mode. The dataset is divided into smaller subsets, with subsets loaded progressively as we iterate over the dataset.
\n", "
" ] }, { "cell_type": "markdown", "id": "21b6316e-8a55-4549-a154-66d3da2ab74a", "metadata": {}, "source": [ "This notebook provides a guide to fine-tuning on the task of _speech recognition_, which involves learning a\n", "mapping from speech to text. Speech recognition is divided into two categories: English-only or multilingual (all other languages). \n", "This notebook applies to both categories, with pointers for changing between languages and datasets.\n", "\n", "As for our model, we'll fine-tune the Whisper model released in [September 2022](https://openai.com/blog/whisper/) by the authors \n", "Alec Radford et al. from OpenAI. Whisper is an encoder-decoder model pre-trained on 680k hours of labelled audio-transcription data. \n", "It achieves strong performance on many speech recognition and speech translation datasets without fine-tuning. With fine-tuning, \n", "we aim to improve upon these results further, with many SoTA results up for grabs! For a full explanation on the Whisper model, the \n", "reader is advised to read the blog post [Fine-Tune Whisper with πŸ€— Transformers](https://huggingface.co/blog/fine-tune-whisper#introduction).\n", "\n", "The Whisper checkpoints come in five configurations of varying model sizes.\n", "The smallest four are trained on either English-only or multilingual data.\n", "The largest checkpoint is multilingual only. All nine of the pre-trained checkpoints \n", "are available on the [Hugging Face Hub](https://huggingface.co/models?search=openai/whisper). The \n", "checkpoints are summarised in the following table with links to the models on the Hub:\n", "\n", "| Size | Layers | Width | Heads | Parameters | English-only | Multilingual |\n", "|--------|--------|-------|-------|------------|------------------------------------------------------|---------------------------------------------------|\n", "| tiny | 4 | 384 | 6 | 39 M | [βœ“](https://huggingface.co/openai/whisper-tiny.en) | [βœ“](https://huggingface.co/openai/whisper-tiny.) |\n", "| base | 6 | 512 | 8 | 74 M | [βœ“](https://huggingface.co/openai/whisper-base.en) | [βœ“](https://huggingface.co/openai/whisper-base) |\n", "| small | 12 | 768 | 12 | 244 M | [βœ“](https://huggingface.co/openai/whisper-small.en) | [βœ“](https://huggingface.co/openai/whisper-small) |\n", "| medium | 24 | 1024 | 16 | 769 M | [βœ“](https://huggingface.co/openai/whisper-medium.en) | [βœ“](https://huggingface.co/openai/whisper-medium) |\n", "| large | 32 | 1280 | 20 | 1550 M | x | [βœ“](https://huggingface.co/openai/whisper-large) |\n", "\n", "When fine-tuning on an English dataset for speech recognition, it is recommeneded to select one of the English-only checkpoints. For any other language, it is recommended to select a multilingual checkpoint.\n", "\n", "For demonstration purposes, we'll fine-tune the multilingual version of the \n", "[`\"small\"`](https://huggingface.co/openai/whisper-small) checkpoint with 244M params (~= 1GB). \n", "As for our data, we'll train and evaluate our system on 400 hours of multilingual speech recognition data\n", "taken from the [Common Voice 11](https://huggingface.co/datasets/mozilla-foundation/common_voice_11_0)\n", "dataset. We'll show how we can train a model on 400 hours of training data using the default disk space \n", "that comes with a standard GPU device or Google Colab." ] }, { "cell_type": "markdown", "id": "b219c9dd-39b6-4a95-b2a1-3f547a1e7bc0", "metadata": {}, "source": [ "## Load Dataset with Streaming" ] }, { "cell_type": "markdown", "id": "b17a4763-4381-4157-ae38-b04a8b5f1c43", "metadata": {}, "source": [ "This is where the magic happens! We'll first write a wrapper function around πŸ€— Datasets `load_dataset` method. This function downloads the required splits using streaming mode by forcing `streaming=True` in the `load_dataset` method. Multiple splits can be combined (interleaved) by concatenating them with the \"+\" symbol when specifying the split name, e.g. `split=train+validation` will return a single split with the training and validation splits interleaved together. The function has the same arguments and key-word arguments as πŸ€— Datasets `load_dataset` method, so we can use it in exactly the same way!" ] }, { "cell_type": "code", "execution_count": 1, "id": "065a8cf7-e54f-4ac3-900e-609c80714fca", "metadata": {}, "outputs": [], "source": [ "from datasets import interleave_datasets, load_dataset\n", "\n", "def load_streaming_dataset(dataset_name, dataset_config_name, split, **kwargs):\n", " if \"+\" in split:\n", " # load multiple splits separated by the `+` symbol *with* streaming mode\n", " dataset_splits = [load_dataset(dataset_name, dataset_config_name, split=split_name, streaming=True, **kwargs) for split_name in split.split(\"+\")]\n", " # interleave multiple splits to form one dataset\n", " interleaved_dataset = interleave_datasets(dataset_splits)\n", " return interleaved_dataset\n", " else:\n", " # load a single split *with* streaming mode\n", " dataset = load_dataset(dataset_name, dataset_config_name, split=split, streaming=True, **kwargs)\n", " return dataset" ] }, { "attachments": {}, "cell_type": "markdown", "id": "674429c5-0ab4-4adf-975b-621bb69eca38", "metadata": {}, "source": [ "We'll train our system on the ~~Spanish~~ Italian split of [Common Voice 11](https://huggingface.co/datasets/mozilla-foundation/common_voice_11_0). We can see how much training data we have by viewing the [language page](https://commonvoice.mozilla.org/en/datasets) on the Common Voice website. ~~The Spanish split has over 400 hours of labelled training data - that's enourmous! More than we could ever fit on a Google Colab or a standard workstation. But with streaming mode, we'll only download data as and when we need it, making training on this dataset possible!~~\n", "\n", "Since ~~Spanish~~ Italian is relatively high-resource, we'll only use the `train` split for training and the `test` split for evaluation. If you're training on a low-resource language, such as the Hindi split of Common Voice 11, it's worth combining the `train` and `validation` splits to give a larger training set. You can achieve this by setting: `split=\"train+validation\"` for the training split.\n", "\n", "If you're using a gated dataset, like Common Voice 11, ensure you have accepted the terms of use on the Hugging Face Hub: [mozilla-foundation/common_voice_11_0](https://huggingface.co/datasets/mozilla-foundation/common_voice_11_0). Once you have accepted the terms, you will have full access to the dataset and be able to load the data locally." ] }, { "cell_type": "code", "execution_count": 2, "id": "a2787582-554f-44ce-9f38-4180a5ed6b44", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "9538e9a33a2e412ab0e42e848e11a9c8", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading builder script: 0%| | 0.00/8.30k [00:00 Dict[str, torch.Tensor]:\n", " # split inputs and labels since they have to be of different lengths and need different padding methods\n", " # first treat the audio inputs by simply returning torch tensors\n", " input_features = [{\"input_features\": feature[\"input_features\"]} for feature in features]\n", " batch = self.processor.feature_extractor.pad(input_features, return_tensors=\"pt\")\n", "\n", " # get the tokenized label sequences\n", " label_features = [{\"input_ids\": feature[\"labels\"]} for feature in features]\n", " # pad the labels to max length\n", " labels_batch = self.processor.tokenizer.pad(label_features, return_tensors=\"pt\")\n", "\n", " # replace padding with -100 to ignore loss correctly\n", " labels = labels_batch[\"input_ids\"].masked_fill(labels_batch.attention_mask.ne(1), -100)\n", "\n", " # if bos token is appended in previous tokenization step,\n", " # cut bos token here as it's append later anyways\n", " if (labels[:, 0] == self.processor.tokenizer.bos_token_id).all().cpu().item():\n", " labels = labels[:, 1:]\n", "\n", " batch[\"labels\"] = labels\n", "\n", " return batch" ] }, { "cell_type": "markdown", "id": "3cae7dbf-8a50-456e-a3a8-7fd005390f86", "metadata": {}, "source": [ "Let's initialise the data collator we've just defined:" ] }, { "cell_type": "code", "execution_count": 13, "id": "fc834702-c0d3-4a96-b101-7b87be32bf42", "metadata": {}, "outputs": [], "source": [ "data_collator = DataCollatorSpeechSeq2SeqWithPadding(processor=processor)" ] }, { "cell_type": "markdown", "id": "d62bb2ab-750a-45e7-82e9-61d6f4805698", "metadata": {}, "source": [ "### Evaluation Metrics" ] }, { "cell_type": "markdown", "id": "66fee1a7-a44c-461e-b047-c3917221572e", "metadata": {}, "source": [ "We'll use the word error rate (WER) metric, the 'de-facto' metric for assessing \n", "ASR systems. For more information, refer to the WER [docs](https://huggingface.co/metrics/wer). We'll load the WER metric from πŸ€— Evaluate:" ] }, { "cell_type": "code", "execution_count": 14, "id": "b22b4011-f31f-4b57-b684-c52332f92890", "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "4edb5a4f20004c98adb5a8855a7ce2c0", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Downloading builder script: 0%| | 0.00/4.49k [00:00\n", " \n", " \n", " [3001/5000 8:52:48 < 5:55:08, 0.09 it/s, Epoch 1.12/9223372036854775807]\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
StepTraining LossValidation LossWer
10000.1570000.25712313.282745
20000.1494000.21112310.135153

" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" }, { "name": "stderr", "output_type": "stream", "text": [ "***** Running Evaluation *****\n", " Num examples: Unknown\n", " Batch size = 8\n", "Reading metadata...: 15003it [00:02, 5938.84it/s]\n", "The following columns in the evaluation set don't have a corresponding argument in `WhisperForConditionalGeneration.forward` and have been ignored: input_length. If input_length are not expected by `WhisperForConditionalGeneration.forward`, you can safely ignore this message.\n", "Saving model checkpoint to ./checkpoint-1000\n", "Configuration saved in ./checkpoint-1000/config.json\n", "Model weights saved in ./checkpoint-1000/pytorch_model.bin\n", "Feature extractor saved in ./checkpoint-1000/preprocessor_config.json\n", "tokenizer config file saved in ./checkpoint-1000/tokenizer_config.json\n", "Special tokens file saved in ./checkpoint-1000/special_tokens_map.json\n", "added tokens file saved in ./checkpoint-1000/added_tokens.json\n", "Feature extractor saved in ./preprocessor_config.json\n", "tokenizer config file saved in ./tokenizer_config.json\n", "Special tokens file saved in ./special_tokens_map.json\n", "added tokens file saved in ./added_tokens.json\n", "***** Running Evaluation *****\n", " Num examples: Unknown\n", " Batch size = 8\n", "Reading metadata...: 15003it [00:00, 39593.28it/s]\n", "The following columns in the evaluation set don't have a corresponding argument in `WhisperForConditionalGeneration.forward` and have been ignored: input_length. If input_length are not expected by `WhisperForConditionalGeneration.forward`, you can safely ignore this message.\n", "Saving model checkpoint to ./checkpoint-2000\n", "Configuration saved in ./checkpoint-2000/config.json\n", "Model weights saved in ./checkpoint-2000/pytorch_model.bin\n", "Feature extractor saved in ./checkpoint-2000/preprocessor_config.json\n", "tokenizer config file saved in ./checkpoint-2000/tokenizer_config.json\n", "Special tokens file saved in ./checkpoint-2000/special_tokens_map.json\n", "added tokens file saved in ./checkpoint-2000/added_tokens.json\n", "Feature extractor saved in ./preprocessor_config.json\n", "tokenizer config file saved in ./tokenizer_config.json\n", "Special tokens file saved in ./special_tokens_map.json\n", "added tokens file saved in ./added_tokens.json\n", "Reading metadata...: 152609it [00:04, 34307.28it/s]\n", "***** Running Evaluation *****\n", " Num examples: Unknown\n", " Batch size = 8\n", "Reading metadata...: 15003it [00:00, 38981.36it/s]\n", "The following columns in the evaluation set don't have a corresponding argument in `WhisperForConditionalGeneration.forward` and have been ignored: input_length. If input_length are not expected by `WhisperForConditionalGeneration.forward`, you can safely ignore this message.\n" ] }, { "ename": "KeyboardInterrupt", "evalue": "", "output_type": "error", "traceback": [ "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)", "Cell \u001b[0;32mIn[22], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m trainer\u001b[39m.\u001b[39;49mtrain()\n", "File \u001b[0;32m~/.env_hf/lib/python3.8/site-packages/transformers/trainer.py:1536\u001b[0m, in \u001b[0;36mTrainer.train\u001b[0;34m(self, resume_from_checkpoint, trial, ignore_keys_for_eval, **kwargs)\u001b[0m\n\u001b[1;32m 1531\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mmodel_wrapped \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mmodel\n\u001b[1;32m 1533\u001b[0m inner_training_loop \u001b[39m=\u001b[39m find_executable_batch_size(\n\u001b[1;32m 1534\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_inner_training_loop, \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_train_batch_size, args\u001b[39m.\u001b[39mauto_find_batch_size\n\u001b[1;32m 1535\u001b[0m )\n\u001b[0;32m-> 1536\u001b[0m \u001b[39mreturn\u001b[39;00m inner_training_loop(\n\u001b[1;32m 1537\u001b[0m args\u001b[39m=\u001b[39;49margs,\n\u001b[1;32m 1538\u001b[0m resume_from_checkpoint\u001b[39m=\u001b[39;49mresume_from_checkpoint,\n\u001b[1;32m 1539\u001b[0m trial\u001b[39m=\u001b[39;49mtrial,\n\u001b[1;32m 1540\u001b[0m ignore_keys_for_eval\u001b[39m=\u001b[39;49mignore_keys_for_eval,\n\u001b[1;32m 1541\u001b[0m )\n", "File \u001b[0;32m~/.env_hf/lib/python3.8/site-packages/transformers/trainer.py:1861\u001b[0m, in \u001b[0;36mTrainer._inner_training_loop\u001b[0;34m(self, batch_size, args, resume_from_checkpoint, trial, ignore_keys_for_eval)\u001b[0m\n\u001b[1;32m 1858\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mstate\u001b[39m.\u001b[39mepoch \u001b[39m=\u001b[39m epoch \u001b[39m+\u001b[39m (step \u001b[39m+\u001b[39m \u001b[39m1\u001b[39m) \u001b[39m/\u001b[39m steps_in_epoch\n\u001b[1;32m 1859\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mcontrol \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mcallback_handler\u001b[39m.\u001b[39mon_step_end(args, \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mstate, \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mcontrol)\n\u001b[0;32m-> 1861\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_maybe_log_save_evaluate(tr_loss, model, trial, epoch, ignore_keys_for_eval)\n\u001b[1;32m 1862\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m 1863\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mcontrol \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mcallback_handler\u001b[39m.\u001b[39mon_substep_end(args, \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mstate, \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mcontrol)\n", "File \u001b[0;32m~/.env_hf/lib/python3.8/site-packages/transformers/trainer.py:2124\u001b[0m, in \u001b[0;36mTrainer._maybe_log_save_evaluate\u001b[0;34m(self, tr_loss, model, trial, epoch, ignore_keys_for_eval)\u001b[0m\n\u001b[1;32m 2118\u001b[0m metrics \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mevaluate(\n\u001b[1;32m 2119\u001b[0m eval_dataset\u001b[39m=\u001b[39meval_dataset,\n\u001b[1;32m 2120\u001b[0m ignore_keys\u001b[39m=\u001b[39mignore_keys_for_eval,\n\u001b[1;32m 2121\u001b[0m metric_key_prefix\u001b[39m=\u001b[39m\u001b[39mf\u001b[39m\u001b[39m\"\u001b[39m\u001b[39meval_\u001b[39m\u001b[39m{\u001b[39;00meval_dataset_name\u001b[39m}\u001b[39;00m\u001b[39m\"\u001b[39m,\n\u001b[1;32m 2122\u001b[0m )\n\u001b[1;32m 2123\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[0;32m-> 2124\u001b[0m metrics \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mevaluate(ignore_keys\u001b[39m=\u001b[39;49mignore_keys_for_eval)\n\u001b[1;32m 2125\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_report_to_hp_search(trial, \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mstate\u001b[39m.\u001b[39mglobal_step, metrics)\n\u001b[1;32m 2127\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mcontrol\u001b[39m.\u001b[39mshould_save:\n", "File \u001b[0;32m~/.env_hf/lib/python3.8/site-packages/transformers/trainer_seq2seq.py:78\u001b[0m, in \u001b[0;36mSeq2SeqTrainer.evaluate\u001b[0;34m(self, eval_dataset, ignore_keys, metric_key_prefix, **gen_kwargs)\u001b[0m\n\u001b[1;32m 73\u001b[0m gen_kwargs[\u001b[39m\"\u001b[39m\u001b[39mnum_beams\u001b[39m\u001b[39m\"\u001b[39m] \u001b[39m=\u001b[39m (\n\u001b[1;32m 74\u001b[0m gen_kwargs[\u001b[39m\"\u001b[39m\u001b[39mnum_beams\u001b[39m\u001b[39m\"\u001b[39m] \u001b[39mif\u001b[39;00m gen_kwargs\u001b[39m.\u001b[39mget(\u001b[39m\"\u001b[39m\u001b[39mnum_beams\u001b[39m\u001b[39m\"\u001b[39m) \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m \u001b[39melse\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39margs\u001b[39m.\u001b[39mgeneration_num_beams\n\u001b[1;32m 75\u001b[0m )\n\u001b[1;32m 76\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_gen_kwargs \u001b[39m=\u001b[39m gen_kwargs\n\u001b[0;32m---> 78\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39msuper\u001b[39;49m()\u001b[39m.\u001b[39;49mevaluate(eval_dataset, ignore_keys\u001b[39m=\u001b[39;49mignore_keys, metric_key_prefix\u001b[39m=\u001b[39;49mmetric_key_prefix)\n", "File \u001b[0;32m~/.env_hf/lib/python3.8/site-packages/transformers/trainer.py:2820\u001b[0m, in \u001b[0;36mTrainer.evaluate\u001b[0;34m(self, eval_dataset, ignore_keys, metric_key_prefix)\u001b[0m\n\u001b[1;32m 2817\u001b[0m start_time \u001b[39m=\u001b[39m time\u001b[39m.\u001b[39mtime()\n\u001b[1;32m 2819\u001b[0m eval_loop \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mprediction_loop \u001b[39mif\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39margs\u001b[39m.\u001b[39muse_legacy_prediction_loop \u001b[39melse\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mevaluation_loop\n\u001b[0;32m-> 2820\u001b[0m output \u001b[39m=\u001b[39m eval_loop(\n\u001b[1;32m 2821\u001b[0m eval_dataloader,\n\u001b[1;32m 2822\u001b[0m description\u001b[39m=\u001b[39;49m\u001b[39m\"\u001b[39;49m\u001b[39mEvaluation\u001b[39;49m\u001b[39m\"\u001b[39;49m,\n\u001b[1;32m 2823\u001b[0m \u001b[39m# No point gathering the predictions if there are no metrics, otherwise we defer to\u001b[39;49;00m\n\u001b[1;32m 2824\u001b[0m \u001b[39m# self.args.prediction_loss_only\u001b[39;49;00m\n\u001b[1;32m 2825\u001b[0m prediction_loss_only\u001b[39m=\u001b[39;49m\u001b[39mTrue\u001b[39;49;00m \u001b[39mif\u001b[39;49;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mcompute_metrics \u001b[39mis\u001b[39;49;00m \u001b[39mNone\u001b[39;49;00m \u001b[39melse\u001b[39;49;00m \u001b[39mNone\u001b[39;49;00m,\n\u001b[1;32m 2826\u001b[0m ignore_keys\u001b[39m=\u001b[39;49mignore_keys,\n\u001b[1;32m 2827\u001b[0m metric_key_prefix\u001b[39m=\u001b[39;49mmetric_key_prefix,\n\u001b[1;32m 2828\u001b[0m )\n\u001b[1;32m 2830\u001b[0m total_batch_size \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39margs\u001b[39m.\u001b[39meval_batch_size \u001b[39m*\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39margs\u001b[39m.\u001b[39mworld_size\n\u001b[1;32m 2831\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mf\u001b[39m\u001b[39m\"\u001b[39m\u001b[39m{\u001b[39;00mmetric_key_prefix\u001b[39m}\u001b[39;00m\u001b[39m_jit_compilation_time\u001b[39m\u001b[39m\"\u001b[39m \u001b[39min\u001b[39;00m output\u001b[39m.\u001b[39mmetrics:\n", "File \u001b[0;32m~/.env_hf/lib/python3.8/site-packages/transformers/trainer.py:3109\u001b[0m, in \u001b[0;36mTrainer.evaluation_loop\u001b[0;34m(self, dataloader, description, prediction_loss_only, ignore_keys, metric_key_prefix)\u001b[0m\n\u001b[1;32m 3105\u001b[0m metrics \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mcompute_metrics(\n\u001b[1;32m 3106\u001b[0m EvalPrediction(predictions\u001b[39m=\u001b[39mall_preds, label_ids\u001b[39m=\u001b[39mall_labels, inputs\u001b[39m=\u001b[39mall_inputs)\n\u001b[1;32m 3107\u001b[0m )\n\u001b[1;32m 3108\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[0;32m-> 3109\u001b[0m metrics \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mcompute_metrics(EvalPrediction(predictions\u001b[39m=\u001b[39;49mall_preds, label_ids\u001b[39m=\u001b[39;49mall_labels))\n\u001b[1;32m 3110\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m 3111\u001b[0m metrics \u001b[39m=\u001b[39m {}\n", "Cell \u001b[0;32mIn[15], line 13\u001b[0m, in \u001b[0;36mcompute_metrics\u001b[0;34m(pred)\u001b[0m\n\u001b[1;32m 11\u001b[0m \u001b[39m# we do not want to group tokens when computing the metrics\u001b[39;00m\n\u001b[1;32m 12\u001b[0m pred_str \u001b[39m=\u001b[39m processor\u001b[39m.\u001b[39mtokenizer\u001b[39m.\u001b[39mbatch_decode(pred_ids, skip_special_tokens\u001b[39m=\u001b[39m\u001b[39mTrue\u001b[39;00m)\n\u001b[0;32m---> 13\u001b[0m label_str \u001b[39m=\u001b[39m processor\u001b[39m.\u001b[39;49mtokenizer\u001b[39m.\u001b[39;49mbatch_decode(label_ids, skip_special_tokens\u001b[39m=\u001b[39;49m\u001b[39mTrue\u001b[39;49;00m)\n\u001b[1;32m 15\u001b[0m \u001b[39mif\u001b[39;00m do_normalize_eval:\n\u001b[1;32m 16\u001b[0m pred_str \u001b[39m=\u001b[39m [normalizer(pred) \u001b[39mfor\u001b[39;00m pred \u001b[39min\u001b[39;00m pred_str]\n", "File \u001b[0;32m~/.env_hf/lib/python3.8/site-packages/transformers/tokenization_utils_base.py:3429\u001b[0m, in \u001b[0;36mPreTrainedTokenizerBase.batch_decode\u001b[0;34m(self, sequences, skip_special_tokens, clean_up_tokenization_spaces, **kwargs)\u001b[0m\n\u001b[1;32m 3406\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mbatch_decode\u001b[39m(\n\u001b[1;32m 3407\u001b[0m \u001b[39mself\u001b[39m,\n\u001b[1;32m 3408\u001b[0m sequences: Union[List[\u001b[39mint\u001b[39m], List[List[\u001b[39mint\u001b[39m]], \u001b[39m\"\u001b[39m\u001b[39mnp.ndarray\u001b[39m\u001b[39m\"\u001b[39m, \u001b[39m\"\u001b[39m\u001b[39mtorch.Tensor\u001b[39m\u001b[39m\"\u001b[39m, \u001b[39m\"\u001b[39m\u001b[39mtf.Tensor\u001b[39m\u001b[39m\"\u001b[39m],\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 3411\u001b[0m \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs\n\u001b[1;32m 3412\u001b[0m ) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m List[\u001b[39mstr\u001b[39m]:\n\u001b[1;32m 3413\u001b[0m \u001b[39m\"\"\"\u001b[39;00m\n\u001b[1;32m 3414\u001b[0m \u001b[39m Convert a list of lists of token ids into a list of strings by calling decode.\u001b[39;00m\n\u001b[1;32m 3415\u001b[0m \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 3427\u001b[0m \u001b[39m `List[str]`: The list of decoded sentences.\u001b[39;00m\n\u001b[1;32m 3428\u001b[0m \u001b[39m \"\"\"\u001b[39;00m\n\u001b[0;32m-> 3429\u001b[0m \u001b[39mreturn\u001b[39;00m [\n\u001b[1;32m 3430\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mdecode(\n\u001b[1;32m 3431\u001b[0m seq,\n\u001b[1;32m 3432\u001b[0m skip_special_tokens\u001b[39m=\u001b[39mskip_special_tokens,\n\u001b[1;32m 3433\u001b[0m clean_up_tokenization_spaces\u001b[39m=\u001b[39mclean_up_tokenization_spaces,\n\u001b[1;32m 3434\u001b[0m \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs,\n\u001b[1;32m 3435\u001b[0m )\n\u001b[1;32m 3436\u001b[0m \u001b[39mfor\u001b[39;00m seq \u001b[39min\u001b[39;00m sequences\n\u001b[1;32m 3437\u001b[0m ]\n", "File \u001b[0;32m~/.env_hf/lib/python3.8/site-packages/transformers/tokenization_utils_base.py:3430\u001b[0m, in \u001b[0;36m\u001b[0;34m(.0)\u001b[0m\n\u001b[1;32m 3406\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mbatch_decode\u001b[39m(\n\u001b[1;32m 3407\u001b[0m \u001b[39mself\u001b[39m,\n\u001b[1;32m 3408\u001b[0m sequences: Union[List[\u001b[39mint\u001b[39m], List[List[\u001b[39mint\u001b[39m]], \u001b[39m\"\u001b[39m\u001b[39mnp.ndarray\u001b[39m\u001b[39m\"\u001b[39m, \u001b[39m\"\u001b[39m\u001b[39mtorch.Tensor\u001b[39m\u001b[39m\"\u001b[39m, \u001b[39m\"\u001b[39m\u001b[39mtf.Tensor\u001b[39m\u001b[39m\"\u001b[39m],\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 3411\u001b[0m \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs\n\u001b[1;32m 3412\u001b[0m ) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m List[\u001b[39mstr\u001b[39m]:\n\u001b[1;32m 3413\u001b[0m \u001b[39m\"\"\"\u001b[39;00m\n\u001b[1;32m 3414\u001b[0m \u001b[39m Convert a list of lists of token ids into a list of strings by calling decode.\u001b[39;00m\n\u001b[1;32m 3415\u001b[0m \n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 3427\u001b[0m \u001b[39m `List[str]`: The list of decoded sentences.\u001b[39;00m\n\u001b[1;32m 3428\u001b[0m \u001b[39m \"\"\"\u001b[39;00m\n\u001b[1;32m 3429\u001b[0m \u001b[39mreturn\u001b[39;00m [\n\u001b[0;32m-> 3430\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mdecode(\n\u001b[1;32m 3431\u001b[0m seq,\n\u001b[1;32m 3432\u001b[0m skip_special_tokens\u001b[39m=\u001b[39;49mskip_special_tokens,\n\u001b[1;32m 3433\u001b[0m clean_up_tokenization_spaces\u001b[39m=\u001b[39;49mclean_up_tokenization_spaces,\n\u001b[1;32m 3434\u001b[0m \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs,\n\u001b[1;32m 3435\u001b[0m )\n\u001b[1;32m 3436\u001b[0m \u001b[39mfor\u001b[39;00m seq \u001b[39min\u001b[39;00m sequences\n\u001b[1;32m 3437\u001b[0m ]\n", "File \u001b[0;32m~/.env_hf/lib/python3.8/site-packages/transformers/tokenization_utils_base.py:3468\u001b[0m, in \u001b[0;36mPreTrainedTokenizerBase.decode\u001b[0;34m(self, token_ids, skip_special_tokens, clean_up_tokenization_spaces, **kwargs)\u001b[0m\n\u001b[1;32m 3465\u001b[0m \u001b[39m# Convert inputs to python lists\u001b[39;00m\n\u001b[1;32m 3466\u001b[0m token_ids \u001b[39m=\u001b[39m to_py_obj(token_ids)\n\u001b[0;32m-> 3468\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_decode(\n\u001b[1;32m 3469\u001b[0m token_ids\u001b[39m=\u001b[39;49mtoken_ids,\n\u001b[1;32m 3470\u001b[0m skip_special_tokens\u001b[39m=\u001b[39;49mskip_special_tokens,\n\u001b[1;32m 3471\u001b[0m clean_up_tokenization_spaces\u001b[39m=\u001b[39;49mclean_up_tokenization_spaces,\n\u001b[1;32m 3472\u001b[0m \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs,\n\u001b[1;32m 3473\u001b[0m )\n", "File \u001b[0;32m~/.env_hf/lib/python3.8/site-packages/transformers/models/whisper/tokenization_whisper.py:496\u001b[0m, in \u001b[0;36mWhisperTokenizer._decode\u001b[0;34m(self, token_ids, skip_special_tokens, normalize, **kwargs)\u001b[0m\n\u001b[1;32m 491\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39m_decode\u001b[39m(\n\u001b[1;32m 492\u001b[0m \u001b[39mself\u001b[39m, token_ids: Union[\u001b[39mint\u001b[39m, List[\u001b[39mint\u001b[39m]], skip_special_tokens: \u001b[39mbool\u001b[39m \u001b[39m=\u001b[39m \u001b[39mFalse\u001b[39;00m, normalize: \u001b[39mbool\u001b[39m \u001b[39m=\u001b[39m \u001b[39mFalse\u001b[39;00m, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs\n\u001b[1;32m 493\u001b[0m ) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m \u001b[39mstr\u001b[39m:\n\u001b[1;32m 494\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_decode_use_source_tokenizer \u001b[39m=\u001b[39m kwargs\u001b[39m.\u001b[39mpop(\u001b[39m\"\u001b[39m\u001b[39muse_source_tokenizer\u001b[39m\u001b[39m\"\u001b[39m, \u001b[39mFalse\u001b[39;00m)\n\u001b[0;32m--> 496\u001b[0m filtered_tokens \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mconvert_ids_to_tokens(token_ids, skip_special_tokens\u001b[39m=\u001b[39;49mskip_special_tokens)\n\u001b[1;32m 498\u001b[0m \u001b[39m# To avoid mixing byte-level and unicode for byte-level BPT\u001b[39;00m\n\u001b[1;32m 499\u001b[0m \u001b[39m# we need to build string separately for added tokens and byte-level tokens\u001b[39;00m\n\u001b[1;32m 500\u001b[0m \u001b[39m# cf. https://github.com/huggingface/transformers/issues/1133\u001b[39;00m\n\u001b[1;32m 501\u001b[0m sub_texts \u001b[39m=\u001b[39m []\n", "File \u001b[0;32m~/.env_hf/lib/python3.8/site-packages/transformers/tokenization_utils.py:907\u001b[0m, in \u001b[0;36mPreTrainedTokenizer.convert_ids_to_tokens\u001b[0;34m(self, ids, skip_special_tokens)\u001b[0m\n\u001b[1;32m 905\u001b[0m \u001b[39mfor\u001b[39;00m index \u001b[39min\u001b[39;00m ids:\n\u001b[1;32m 906\u001b[0m index \u001b[39m=\u001b[39m \u001b[39mint\u001b[39m(index)\n\u001b[0;32m--> 907\u001b[0m \u001b[39mif\u001b[39;00m skip_special_tokens \u001b[39mand\u001b[39;00m index \u001b[39min\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mall_special_ids:\n\u001b[1;32m 908\u001b[0m \u001b[39mcontinue\u001b[39;00m\n\u001b[1;32m 909\u001b[0m \u001b[39mif\u001b[39;00m index \u001b[39min\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39madded_tokens_decoder:\n", "File \u001b[0;32m~/.env_hf/lib/python3.8/site-packages/transformers/tokenization_utils_base.py:1297\u001b[0m, in \u001b[0;36mSpecialTokensMixin.all_special_ids\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1292\u001b[0m \u001b[39m@property\u001b[39m\n\u001b[1;32m 1293\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mall_special_ids\u001b[39m(\u001b[39mself\u001b[39m) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m List[\u001b[39mint\u001b[39m]:\n\u001b[1;32m 1294\u001b[0m \u001b[39m\"\"\"\u001b[39;00m\n\u001b[1;32m 1295\u001b[0m \u001b[39m `List[int]`: List the ids of the special tokens(`''`, `''`, etc.) mapped to class attributes.\u001b[39;00m\n\u001b[1;32m 1296\u001b[0m \u001b[39m \"\"\"\u001b[39;00m\n\u001b[0;32m-> 1297\u001b[0m all_toks \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mall_special_tokens\n\u001b[1;32m 1298\u001b[0m all_ids \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mconvert_tokens_to_ids(all_toks)\n\u001b[1;32m 1299\u001b[0m \u001b[39mreturn\u001b[39;00m all_ids\n", "File \u001b[0;32m~/.env_hf/lib/python3.8/site-packages/transformers/tokenization_utils_base.py:1273\u001b[0m, in \u001b[0;36mSpecialTokensMixin.all_special_tokens\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1266\u001b[0m \u001b[39m@property\u001b[39m\n\u001b[1;32m 1267\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mall_special_tokens\u001b[39m(\u001b[39mself\u001b[39m) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m List[\u001b[39mstr\u001b[39m]:\n\u001b[1;32m 1268\u001b[0m \u001b[39m\"\"\"\u001b[39;00m\n\u001b[1;32m 1269\u001b[0m \u001b[39m `List[str]`: All the special tokens (`''`, `''`, etc.) mapped to class attributes.\u001b[39;00m\n\u001b[1;32m 1270\u001b[0m \n\u001b[1;32m 1271\u001b[0m \u001b[39m Convert tokens of `tokenizers.AddedToken` type to string.\u001b[39;00m\n\u001b[1;32m 1272\u001b[0m \u001b[39m \"\"\"\u001b[39;00m\n\u001b[0;32m-> 1273\u001b[0m all_toks \u001b[39m=\u001b[39m [\u001b[39mstr\u001b[39m(s) \u001b[39mfor\u001b[39;00m s \u001b[39min\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mall_special_tokens_extended]\n\u001b[1;32m 1274\u001b[0m \u001b[39mreturn\u001b[39;00m all_toks\n", "File \u001b[0;32m~/.env_hf/lib/python3.8/site-packages/transformers/tokenization_utils_base.py:1289\u001b[0m, in \u001b[0;36mSpecialTokensMixin.all_special_tokens_extended\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1287\u001b[0m \u001b[39mfor\u001b[39;00m attr_value \u001b[39min\u001b[39;00m set_attr\u001b[39m.\u001b[39mvalues():\n\u001b[1;32m 1288\u001b[0m all_toks \u001b[39m=\u001b[39m all_toks \u001b[39m+\u001b[39m (\u001b[39mlist\u001b[39m(attr_value) \u001b[39mif\u001b[39;00m \u001b[39misinstance\u001b[39m(attr_value, (\u001b[39mlist\u001b[39m, \u001b[39mtuple\u001b[39m)) \u001b[39melse\u001b[39;00m [attr_value])\n\u001b[0;32m-> 1289\u001b[0m all_toks \u001b[39m=\u001b[39m \u001b[39mlist\u001b[39;49m(OrderedDict\u001b[39m.\u001b[39;49mfromkeys(all_toks))\n\u001b[1;32m 1290\u001b[0m \u001b[39mreturn\u001b[39;00m all_toks\n", "\u001b[0;31mKeyboardInterrupt\u001b[0m: " ] } ], "source": [ "trainer.train()" ] }, { "cell_type": "markdown", "id": "747c6a6e", "metadata": { "pycharm": { "name": "#%% md\n" } }, "source": [ "(note that training may take some time to commence as we load the first training data samples with streaming mode)" ] }, { "cell_type": "markdown", "id": "810ced54-7187-4a06-b2fe-ba6dcca94dc3", "metadata": {}, "source": [ "We can label our checkpoint with the `whisper-event` tag on push by setting the appropriate key-word arguments (kwargs):" ] }, { "cell_type": "code", "execution_count": 23, "id": "6dd0e310-9b07-4133-ac14-2ed2d7524e22", "metadata": {}, "outputs": [], "source": [ "kwargs = {\n", " \"dataset_tags\": \"mozilla-foundation/common_voice_11_0\",\n", " \"dataset\": \"Common Voice 11.0\", # a 'pretty' name for the training dataset\n", " \"language\": \"it\",\n", " \"model_name\": \"Whisper Small It - Edoardo Abati\", # a 'pretty' name for your model\n", " \"finetuned_from\": \"openai/whisper-small\",\n", " \"tasks\": \"automatic-speech-recognition\",\n", " \"tags\": \"whisper-event\",\n", "}" ] }, { "cell_type": "markdown", "id": "090d676a-f944-4297-a938-a40eda0b2b68", "metadata": {}, "source": [ "The training results can now be uploaded to the Hub. To do so, execute the `push_to_hub` command:" ] }, { "cell_type": "code", "execution_count": 24, "id": "95737cda-c5dd-4887-a4d0-dfcb0d61d977", "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Saving model checkpoint to ./\n", "Configuration saved in ./config.json\n", "Model weights saved in ./pytorch_model.bin\n", "Feature extractor saved in ./preprocessor_config.json\n", "tokenizer config file saved in ./tokenizer_config.json\n", "Special tokens file saved in ./special_tokens_map.json\n", "added tokens file saved in ./added_tokens.json\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "308a037772114b6e97be821a2d5fa82d", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Upload file pytorch_model.bin: 0%| | 32.0k/922M [00:00 main\n", "\n", "Dropping the following result as it does not have all the necessary fields:\n", "{'task': {'name': 'Automatic Speech Recognition', 'type': 'automatic-speech-recognition'}, 'dataset': {'name': 'Common Voice 11.0', 'type': 'mozilla-foundation/common_voice_11_0', 'config': 'it', 'split': 'test', 'args': 'it'}}\n" ] } ], "source": [ "trainer.push_to_hub(**kwargs)" ] }, { "cell_type": "code", "execution_count": null, "id": "b054b753", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": ".env_hf", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.10" }, "vscode": { "interpreter": { "hash": "e03d167d6d3d33eeb87d1b1877fbbf6f3294bea5bc6e45cd3e7af1e20d2543a5" } } }, "nbformat": 4, "nbformat_minor": 5 }