{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# HuggingFace challenge - Debugger notebook\n", "Run this notebook to verify your libraries versions, check GPU config and run a quick training" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "id": "T2utsYSKszvv" }, "outputs": [], "source": [ "import platform\n", "import multiprocessing\n", "\n", "import torch\n", "import transformers\n", "import datasets\n", "\n", "import soundfile" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Print main infos" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "5P6I-W9ts-kR", "outputId": "939bd550-1486-46a6-8371-e82ada0f448c" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Platform: Linux-5.11.0-37-generic-x86_64-with-glibc2.10\n", "CPU cores: 60\n", "Python version: 3.8.8\n", "PyTorch version: 1.10.1+cu102\n", "GPU is visible: True\n", "Transformers version: 4.16.0.dev0\n", "Datasets version: 1.17.1.dev0\n", "soundfile version: 0.10.3\n" ] } ], "source": [ "print(f\"Platform: {platform.platform()}\")\n", "print(f\"CPU cores: {multiprocessing.cpu_count()}\")\n", "\n", "print(f\"Python version: {platform.python_version()}\")\n", "\n", "print(f\"PyTorch version: {torch.__version__}\")\n", "print(f\"GPU is visible: {torch.cuda.is_available()}\")\n", "\n", "print(f\"Transformers version: {transformers.__version__}\")\n", "print(f\"Datasets version: {datasets.__version__}\")\n", "\n", "print(f\"soundfile version: {soundfile.__version__}\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Check your GPU informations (if any)\n", "If you launched an AI Training job with GPU resources, they should be listed below (Tesla V100s 32GB).\n", "Driver and CUDA version " ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "YT7fRnKctggU", "outputId": "f355a3e0-20da-489f-bd1f-5e508e792a68" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Fri Jan 21 17:23:04 2022 \n", "+-----------------------------------------------------------------------------+\n", "| NVIDIA-SMI 470.57.02 Driver Version: 470.57.02 CUDA Version: 11.4 |\n", "|-------------------------------+----------------------+----------------------+\n", "| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |\n", "| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |\n", "| | | MIG M. |\n", "|===============================+======================+======================|\n", "| 0 Tesla V100S-PCI... Off | 00000000:00:06.0 Off | 0 |\n", "| N/A 35C P0 26W / 250W | 4MiB / 32510MiB | 0% Default |\n", "| | | N/A |\n", "+-------------------------------+----------------------+----------------------+\n", " \n", "+-----------------------------------------------------------------------------+\n", "| Processes: |\n", "| GPU GI CI PID Type Process name GPU Memory |\n", "| ID ID Usage |\n", "|=============================================================================|\n", "| No running processes found |\n", "+-----------------------------------------------------------------------------+\n" ] } ], "source": [ "!nvidia-smi" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "1f72bffe678b4bdca366b35305baaab5", "version_major": 2, "version_minor": 0 }, "text/plain": [ "VBox(children=(HTML(value='
\\n] 29.64K --.-KB/s in 0.002s \n", "\n", "2022-01-21 13:32:51 (18.2 MB/s) - ‘run_speech_recognition_ctc.py’ saved [30348/30348]\n", "\n" ] } ], "source": [ "!wget -O run_speech_recognition_ctc.py https://raw.githubusercontent.com/huggingface/transformers/master/examples/pytorch/speech-recognition/run_speech_recognition_ctc.py" ] }, { "cell_type": "code", "execution_count": 34, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "Mz4bubhxxsad", "outputId": "23398525-cc19-43c2-9fec-497e06214f29" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "01/21/2022 17:27:56 - WARNING - __main__ - Process rank: -1, device: cuda:0, n_gpu: 1distributed training: False, 16-bits training: True\n", "01/21/2022 17:27:56 - INFO - __main__ - Training/evaluation parameters TrainingArguments(\n", "_n_gpu=1,\n", "adafactor=False,\n", "adam_beta1=0.9,\n", "adam_beta2=0.999,\n", "adam_epsilon=1e-08,\n", "bf16=False,\n", "bf16_full_eval=False,\n", "dataloader_drop_last=False,\n", "dataloader_num_workers=0,\n", "dataloader_pin_memory=True,\n", "ddp_bucket_cap_mb=None,\n", "ddp_find_unused_parameters=None,\n", "debug=[],\n", "deepspeed=None,\n", "disable_tqdm=False,\n", "do_eval=True,\n", "do_predict=False,\n", "do_train=True,\n", "eval_accumulation_steps=None,\n", "eval_steps=500,\n", "evaluation_strategy=IntervalStrategy.STEPS,\n", "fp16=True,\n", "fp16_backend=auto,\n", "fp16_full_eval=False,\n", "fp16_opt_level=O1,\n", "gradient_accumulation_steps=1,\n", "gradient_checkpointing=True,\n", "greater_is_better=None,\n", "group_by_length=True,\n", "half_precision_backend=auto,\n", "hub_model_id=None,\n", "hub_strategy=HubStrategy.EVERY_SAVE,\n", "hub_token=,\n", "ignore_data_skip=False,\n", "label_names=None,\n", "label_smoothing_factor=0.0,\n", "learning_rate=7.5e-05,\n", "length_column_name=input_length,\n", "load_best_model_at_end=False,\n", "local_rank=-1,\n", "log_level=-1,\n", "log_level_replica=-1,\n", "log_on_each_node=True,\n", "logging_dir=./wav2vec2-large-xls-r-300m-hindi/runs/Jan21_17-27-56_job-8be8b741-e32e-4579-bbec-1e00d9824b4f,\n", "logging_first_step=False,\n", "logging_nan_inf_filter=True,\n", "logging_steps=100,\n", "logging_strategy=IntervalStrategy.STEPS,\n", "lr_scheduler_type=SchedulerType.LINEAR,\n", "max_grad_norm=1.0,\n", "max_steps=-1,\n", "metric_for_best_model=None,\n", "mp_parameters=,\n", "no_cuda=False,\n", "num_train_epochs=100.0,\n", "optim=OptimizerNames.ADAMW_HF,\n", "output_dir=./wav2vec2-large-xls-r-300m-hindi,\n", "overwrite_output_dir=True,\n", "past_index=-1,\n", "per_device_eval_batch_size=32,\n", "per_device_train_batch_size=32,\n", "prediction_loss_only=False,\n", "push_to_hub=True,\n", "push_to_hub_model_id=None,\n", "push_to_hub_organization=None,\n", "push_to_hub_token=,\n", "remove_unused_columns=True,\n", "report_to=[],\n", "resume_from_checkpoint=None,\n", "run_name=./wav2vec2-large-xls-r-300m-hindi,\n", "save_on_each_node=False,\n", "save_steps=500,\n", "save_strategy=IntervalStrategy.STEPS,\n", "save_total_limit=3,\n", "seed=42,\n", "sharded_ddp=[],\n", "skip_memory_metrics=True,\n", "tf32=None,\n", "tpu_metrics_debug=False,\n", "tpu_num_cores=None,\n", "use_legacy_prediction_loop=False,\n", "warmup_ratio=0.0,\n", "warmup_steps=2000,\n", "weight_decay=0.0,\n", "xpu_backend=None,\n", ")\n", "01/21/2022 17:27:58 - WARNING - datasets.builder - Reusing dataset common_voice (/workspace/.cache/huggingface/datasets/mozilla-foundation___common_voice/hi/7.0.0/33e08856cfa0d0665e837bcad73ffd920a0bc713ce8c5fffb55dbdf1c084d5ba)\n", "01/21/2022 17:28:01 - WARNING - datasets.builder - Reusing dataset common_voice (/workspace/.cache/huggingface/datasets/mozilla-foundation___common_voice/hi/7.0.0/33e08856cfa0d0665e837bcad73ffd920a0bc713ce8c5fffb55dbdf1c084d5ba)\n", "01/21/2022 17:28:01 - WARNING - datasets.arrow_dataset - Loading cached processed dataset at /workspace/.cache/huggingface/datasets/mozilla-foundation___common_voice/hi/7.0.0/33e08856cfa0d0665e837bcad73ffd920a0bc713ce8c5fffb55dbdf1c084d5ba/cache-5429990fadba3bab.arrow\n", "01/21/2022 17:28:01 - WARNING - datasets.arrow_dataset - Loading cached processed dataset at /workspace/.cache/huggingface/datasets/mozilla-foundation___common_voice/hi/7.0.0/33e08856cfa0d0665e837bcad73ffd920a0bc713ce8c5fffb55dbdf1c084d5ba/cache-7555c0f50082da96.arrow\n", "loading configuration file https://huggingface.co/facebook/wav2vec2-xls-r-300m/resolve/main/config.json from cache at /workspace/.cache/huggingface/transformers/dabc27df63e37bd2a7a221c7774e35f36a280fbdf917cf54cadfc7df8c786f6f.a3e4c3c967d9985881e0ae550a5f6f668f897db5ab2e0802f9b97973b15970e6\n", "Model config Wav2Vec2Config {\n", " \"_name_or_path\": \"facebook/wav2vec2-xls-r-300m\",\n", " \"activation_dropout\": 0.0,\n", " \"adapter_kernel_size\": 3,\n", " \"adapter_stride\": 2,\n", " \"add_adapter\": false,\n", " \"apply_spec_augment\": true,\n", " \"architectures\": [\n", " \"Wav2Vec2ForPreTraining\"\n", " ],\n", " \"attention_dropout\": 0.1,\n", " \"bos_token_id\": 1,\n", " \"classifier_proj_size\": 256,\n", " \"codevector_dim\": 768,\n", " \"contrastive_logits_temperature\": 0.1,\n", " \"conv_bias\": true,\n", " \"conv_dim\": [\n", " 512,\n", " 512,\n", " 512,\n", " 512,\n", " 512,\n", " 512,\n", " 512\n", " ],\n", " \"conv_kernel\": [\n", " 10,\n", " 3,\n", " 3,\n", " 3,\n", " 3,\n", " 2,\n", " 2\n", " ],\n", " \"conv_stride\": [\n", " 5,\n", " 2,\n", " 2,\n", " 2,\n", " 2,\n", " 2,\n", " 2\n", " ],\n", " \"ctc_loss_reduction\": \"sum\",\n", " \"ctc_zero_infinity\": false,\n", " \"diversity_loss_weight\": 0.1,\n", " \"do_stable_layer_norm\": true,\n", " \"eos_token_id\": 2,\n", " \"feat_extract_activation\": \"gelu\",\n", " \"feat_extract_dropout\": 0.0,\n", " \"feat_extract_norm\": \"layer\",\n", " \"feat_proj_dropout\": 0.1,\n", " \"feat_quantizer_dropout\": 0.0,\n", " \"final_dropout\": 0.0,\n", " \"gradient_checkpointing\": false,\n", " \"hidden_act\": \"gelu\",\n", " \"hidden_dropout\": 0.1,\n", " \"hidden_size\": 1024,\n", " \"initializer_range\": 0.02,\n", " \"intermediate_size\": 4096,\n", " \"layer_norm_eps\": 1e-05,\n", " \"layerdrop\": 0.1,\n", " \"mask_feature_length\": 10,\n", " \"mask_feature_min_masks\": 0,\n", " \"mask_feature_prob\": 0.0,\n", " \"mask_time_length\": 10,\n", " \"mask_time_min_masks\": 2,\n", " \"mask_time_prob\": 0.075,\n", " \"model_type\": \"wav2vec2\",\n", " \"num_adapter_layers\": 3,\n", " \"num_attention_heads\": 16,\n", " \"num_codevector_groups\": 2,\n", " \"num_codevectors_per_group\": 320,\n", " \"num_conv_pos_embedding_groups\": 16,\n", " \"num_conv_pos_embeddings\": 128,\n", " \"num_feat_extract_layers\": 7,\n", " \"num_hidden_layers\": 24,\n", " \"num_negatives\": 100,\n", " \"output_hidden_size\": 1024,\n", " \"pad_token_id\": 0,\n", " \"proj_codevector_dim\": 768,\n", " \"tdnn_dilation\": [\n", " 1,\n", " 2,\n", " 3,\n", " 1,\n", " 1\n", " ],\n", " \"tdnn_dim\": [\n", " 512,\n", " 512,\n", " 512,\n", " 512,\n", " 1500\n", " ],\n", " \"tdnn_kernel\": [\n", " 5,\n", " 3,\n", " 3,\n", " 1,\n", " 1\n", " ],\n", " \"torch_dtype\": \"float32\",\n", " \"transformers_version\": \"4.16.0.dev0\",\n", " \"use_weighted_layer_sum\": false,\n", " \"vocab_size\": 32,\n", " \"xvector_output_dim\": 512\n", "}\n", "\n", "100%|█████████████████████████████████████████████| 1/1 [00:00<00:00, 4.66ba/s]\n", "100%|█████████████████████████████████████████████| 1/1 [00:00<00:00, 17.16ba/s]\n", "Didn't find file ./wav2vec2-large-xls-r-300m-hindi/tokenizer_config.json. We won't load it.\n", "Didn't find file ./wav2vec2-large-xls-r-300m-hindi/added_tokens.json. We won't load it.\n", "Didn't find file ./wav2vec2-large-xls-r-300m-hindi/special_tokens_map.json. We won't load it.\n", "Didn't find file ./wav2vec2-large-xls-r-300m-hindi/tokenizer.json. We won't load it.\n", "loading file ./wav2vec2-large-xls-r-300m-hindi/vocab.json\n", "loading file None\n", "loading file None\n", "loading file None\n", "loading file None\n", "file ./wav2vec2-large-xls-r-300m-hindi/config.json not found\n", "Adding to the vocabulary\n", "Adding to the vocabulary\n", "Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.\n", "loading configuration file https://huggingface.co/facebook/wav2vec2-xls-r-300m/resolve/main/config.json from cache at /workspace/.cache/huggingface/transformers/dabc27df63e37bd2a7a221c7774e35f36a280fbdf917cf54cadfc7df8c786f6f.a3e4c3c967d9985881e0ae550a5f6f668f897db5ab2e0802f9b97973b15970e6\n", "Model config Wav2Vec2Config {\n", " \"_name_or_path\": \"facebook/wav2vec2-xls-r-300m\",\n", " \"activation_dropout\": 0.0,\n", " \"adapter_kernel_size\": 3,\n", " \"adapter_stride\": 2,\n", " \"add_adapter\": false,\n", " \"apply_spec_augment\": true,\n", " \"architectures\": [\n", " \"Wav2Vec2ForPreTraining\"\n", " ],\n", " \"attention_dropout\": 0.1,\n", " \"bos_token_id\": 1,\n", " \"classifier_proj_size\": 256,\n", " \"codevector_dim\": 768,\n", " \"contrastive_logits_temperature\": 0.1,\n", " \"conv_bias\": true,\n", " \"conv_dim\": [\n", " 512,\n", " 512,\n", " 512,\n", " 512,\n", " 512,\n", " 512,\n", " 512\n", " ],\n", " \"conv_kernel\": [\n", " 10,\n", " 3,\n", " 3,\n", " 3,\n", " 3,\n", " 2,\n", " 2\n", " ],\n", " \"conv_stride\": [\n", " 5,\n", " 2,\n", " 2,\n", " 2,\n", " 2,\n", " 2,\n", " 2\n", " ],\n", " \"ctc_loss_reduction\": \"sum\",\n", " \"ctc_zero_infinity\": false,\n", " \"diversity_loss_weight\": 0.1,\n", " \"do_stable_layer_norm\": true,\n", " \"eos_token_id\": 2,\n", " \"feat_extract_activation\": \"gelu\",\n", " \"feat_extract_dropout\": 0.0,\n", " \"feat_extract_norm\": \"layer\",\n", " \"feat_proj_dropout\": 0.1,\n", " \"feat_quantizer_dropout\": 0.0,\n", " \"final_dropout\": 0.0,\n", " \"gradient_checkpointing\": false,\n", " \"hidden_act\": \"gelu\",\n", " \"hidden_dropout\": 0.1,\n", " \"hidden_size\": 1024,\n", " \"initializer_range\": 0.02,\n", " \"intermediate_size\": 4096,\n", " \"layer_norm_eps\": 1e-05,\n", " \"layerdrop\": 0.1,\n", " \"mask_feature_length\": 10,\n", " \"mask_feature_min_masks\": 0,\n", " \"mask_feature_prob\": 0.0,\n", " \"mask_time_length\": 10,\n", " \"mask_time_min_masks\": 2,\n", " \"mask_time_prob\": 0.075,\n", " \"model_type\": \"wav2vec2\",\n", " \"num_adapter_layers\": 3,\n", " \"num_attention_heads\": 16,\n", " \"num_codevector_groups\": 2,\n", " \"num_codevectors_per_group\": 320,\n", " \"num_conv_pos_embedding_groups\": 16,\n", " \"num_conv_pos_embeddings\": 128,\n", " \"num_feat_extract_layers\": 7,\n", " \"num_hidden_layers\": 24,\n", " \"num_negatives\": 100,\n", " \"output_hidden_size\": 1024,\n", " \"pad_token_id\": 0,\n", " \"proj_codevector_dim\": 768,\n", " \"tdnn_dilation\": [\n", " 1,\n", " 2,\n", " 3,\n", " 1,\n", " 1\n", " ],\n", " \"tdnn_dim\": [\n", " 512,\n", " 512,\n", " 512,\n", " 512,\n", " 1500\n", " ],\n", " \"tdnn_kernel\": [\n", " 5,\n", " 3,\n", " 3,\n", " 1,\n", " 1\n", " ],\n", " \"torch_dtype\": \"float32\",\n", " \"transformers_version\": \"4.16.0.dev0\",\n", " \"use_weighted_layer_sum\": false,\n", " \"vocab_size\": 32,\n", " \"xvector_output_dim\": 512\n", "}\n", "\n", "loading feature extractor configuration file https://huggingface.co/facebook/wav2vec2-xls-r-300m/resolve/main/preprocessor_config.json from cache at /workspace/.cache/huggingface/transformers/6fb028b95b394059e7d3b367bbca2382b576c66aebe896f04d2cd34e1b575f5b.d4484dc1c81456a2461485e7168b04347a7b9a4e3b1ef3aba723323b33e12326\n", "Feature extractor Wav2Vec2FeatureExtractor {\n", " \"do_normalize\": true,\n", " \"feature_extractor_type\": \"Wav2Vec2FeatureExtractor\",\n", " \"feature_size\": 1,\n", " \"padding_side\": \"right\",\n", " \"padding_value\": 0,\n", " \"return_attention_mask\": true,\n", " \"sampling_rate\": 16000\n", "}\n", "\n", "loading weights file https://huggingface.co/facebook/wav2vec2-xls-r-300m/resolve/main/pytorch_model.bin from cache at /workspace/.cache/huggingface/transformers/1e6a6507f3b689035cd4b247e2a37c154e27f39143f31357a49b4e38baeccc36.1edb32803799e27ed554eb7dd935f6745b1a0b17b0ea256442fe24db6eb546cd\n", "Some weights of the model checkpoint at facebook/wav2vec2-xls-r-300m were not used when initializing Wav2Vec2ForCTC: ['project_hid.weight', 'project_hid.bias', 'quantizer.weight_proj.bias', 'project_q.weight', 'project_q.bias', 'quantizer.weight_proj.weight', 'quantizer.codevectors']\n", "- This IS expected if you are initializing Wav2Vec2ForCTC from the checkpoint of a model trained on another task or with another architecture (e.g. initializing a BertForSequenceClassification model from a BertForPreTraining model).\n", "- This IS NOT expected if you are initializing Wav2Vec2ForCTC from the checkpoint of a model that you expect to be exactly identical (initializing a BertForSequenceClassification model from a BertForSequenceClassification model).\n", "Some weights of Wav2Vec2ForCTC were not initialized from the model checkpoint at facebook/wav2vec2-xls-r-300m and are newly initialized: ['lm_head.weight', 'lm_head.bias']\n", "You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.\n", "preprocess datasets: 100%|█████████████████| 4711/4711 [00:30<00:00, 153.38ex/s]\n", "preprocess datasets: 100%|█████████████████| 2095/2095 [00:16<00:00, 128.84ex/s]\n", "100%|████████████████████████████████████████████| 5/5 [00:00<00:00, 729.80ba/s]\n", "100%|████████████████████████████████████████████| 3/3 [00:00<00:00, 446.54ba/s]\n", "Configuration saved in ./wav2vec2-large-xls-r-300m-hindi/preprocessor_config.json\n", "tokenizer config file saved in ./wav2vec2-large-xls-r-300m-hindi/tokenizer_config.json\n", "Special tokens file saved in ./wav2vec2-large-xls-r-300m-hindi/special_tokens_map.json\n", "added tokens file saved in ./wav2vec2-large-xls-r-300m-hindi/added_tokens.json\n", "Configuration saved in ./wav2vec2-large-xls-r-300m-hindi/config.json\n", "loading feature extractor configuration file ./wav2vec2-large-xls-r-300m-hindi/preprocessor_config.json\n", "loading configuration file ./wav2vec2-large-xls-r-300m-hindi/config.json\n", "Model config Wav2Vec2Config {\n", " \"_name_or_path\": \"./wav2vec2-large-xls-r-300m-hindi\",\n", " \"activation_dropout\": 0.1,\n", " \"adapter_kernel_size\": 3,\n", " \"adapter_stride\": 2,\n", " \"add_adapter\": false,\n", " \"apply_spec_augment\": true,\n", " \"architectures\": [\n", " \"Wav2Vec2ForPreTraining\"\n", " ],\n", " \"attention_dropout\": 0.0,\n", " \"bos_token_id\": 1,\n", " \"classifier_proj_size\": 256,\n", " \"codevector_dim\": 768,\n", " \"contrastive_logits_temperature\": 0.1,\n", " \"conv_bias\": true,\n", " \"conv_dim\": [\n", " 512,\n", " 512,\n", " 512,\n", " 512,\n", " 512,\n", " 512,\n", " 512\n", " ],\n", " \"conv_kernel\": [\n", " 10,\n", " 3,\n", " 3,\n", " 3,\n", " 3,\n", " 2,\n", " 2\n", " ],\n", " \"conv_stride\": [\n", " 5,\n", " 2,\n", " 2,\n", " 2,\n", " 2,\n", " 2,\n", " 2\n", " ],\n", " \"ctc_loss_reduction\": \"mean\",\n", " \"ctc_zero_infinity\": false,\n", " \"diversity_loss_weight\": 0.1,\n", " \"do_stable_layer_norm\": true,\n", " \"eos_token_id\": 2,\n", " \"feat_extract_activation\": \"gelu\",\n", " \"feat_extract_dropout\": 0.0,\n", " \"feat_extract_norm\": \"layer\",\n", " \"feat_proj_dropout\": 0.0,\n", " \"feat_quantizer_dropout\": 0.0,\n", " \"final_dropout\": 0.0,\n", " \"hidden_act\": \"gelu\",\n", " \"hidden_dropout\": 0.0,\n", " \"hidden_size\": 1024,\n", " \"initializer_range\": 0.02,\n", " \"intermediate_size\": 4096,\n", " \"layer_norm_eps\": 1e-05,\n", " \"layerdrop\": 0.0,\n", " \"mask_feature_length\": 64,\n", " \"mask_feature_min_masks\": 0,\n", " \"mask_feature_prob\": 0.25,\n", " \"mask_time_length\": 10,\n", " \"mask_time_min_masks\": 2,\n", " \"mask_time_prob\": 0.75,\n", " \"model_type\": \"wav2vec2\",\n", " \"num_adapter_layers\": 3,\n", " \"num_attention_heads\": 16,\n", " \"num_codevector_groups\": 2,\n", " \"num_codevectors_per_group\": 320,\n", " \"num_conv_pos_embedding_groups\": 16,\n", " \"num_conv_pos_embeddings\": 128,\n", " \"num_feat_extract_layers\": 7,\n", " \"num_hidden_layers\": 24,\n", " \"num_negatives\": 100,\n", " \"output_hidden_size\": 1024,\n", " \"pad_token_id\": 68,\n", " \"proj_codevector_dim\": 768,\n", " \"tdnn_dilation\": [\n", " 1,\n", " 2,\n", " 3,\n", " 1,\n", " 1\n", " ],\n", " \"tdnn_dim\": [\n", " 512,\n", " 512,\n", " 512,\n", " 512,\n", " 1500\n", " ],\n", " \"tdnn_kernel\": [\n", " 5,\n", " 3,\n", " 3,\n", " 1,\n", " 1\n", " ],\n", " \"torch_dtype\": \"float32\",\n", " \"transformers_version\": \"4.16.0.dev0\",\n", " \"use_weighted_layer_sum\": false,\n", " \"vocab_size\": 70,\n", " \"xvector_output_dim\": 512\n", "}\n", "\n", "loading feature extractor configuration file ./wav2vec2-large-xls-r-300m-hindi/preprocessor_config.json\n", "Feature extractor Wav2Vec2FeatureExtractor {\n", " \"do_normalize\": true,\n", " \"feature_extractor_type\": \"Wav2Vec2FeatureExtractor\",\n", " \"feature_size\": 1,\n", " \"padding_side\": \"right\",\n", " \"padding_value\": 0,\n", " \"return_attention_mask\": true,\n", " \"sampling_rate\": 16000\n", "}\n", "\n", "Didn't find file ./wav2vec2-large-xls-r-300m-hindi/tokenizer.json. We won't load it.\n", "loading file ./wav2vec2-large-xls-r-300m-hindi/vocab.json\n", "loading file ./wav2vec2-large-xls-r-300m-hindi/tokenizer_config.json\n", "loading file ./wav2vec2-large-xls-r-300m-hindi/added_tokens.json\n", "loading file ./wav2vec2-large-xls-r-300m-hindi/special_tokens_map.json\n", "loading file None\n", "Adding to the vocabulary\n", "Adding to the vocabulary\n", "Cloning https://huggingface.co/infinitejoy/wav2vec2-large-xls-r-300m-hindi into local empty directory.\n", "01/21/2022 17:29:04 - WARNING - huggingface_hub.repository - Cloning https://huggingface.co/infinitejoy/wav2vec2-large-xls-r-300m-hindi into local empty directory.\n", "Download file pytorch_model.bin: 0%| | 1.58k/1.18G [00:00 main\n", "\n", "01/22/2022 00:17:33 - WARNING - huggingface_hub.repository - To https://huggingface.co/infinitejoy/wav2vec2-large-xls-r-300m-hindi\n", " 13be5b6..aac3ebd main -> main\n", "\n", "Upload file pytorch_model.bin: 100%|███████| 1.18G/1.18G [00:53<00:00, 23.6MB/s]\n", "Dropping the following result as it does not have all the necessary fields:\n", "{'dataset': {'name': 'MOZILLA-FOUNDATION/COMMON_VOICE_7_0 - HI', 'type': 'common_voice', 'args': 'Config: hi, Training split: train+validation, Eval split: test'}}\n", "To https://huggingface.co/infinitejoy/wav2vec2-large-xls-r-300m-hindi\n", " aac3ebd..ae07d7b main -> main\n", "\n", "01/22/2022 00:17:40 - WARNING - huggingface_hub.repository - To https://huggingface.co/infinitejoy/wav2vec2-large-xls-r-300m-hindi\n", " aac3ebd..ae07d7b main -> main\n", "\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 00:18:19 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 00:21:48 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 00:25:16 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 00:28:45 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 00:32:14 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 00:35:42 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 00:42:39 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 00:46:08 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 00:53:05 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 01:00:02 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 01:03:31 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 01:07:00 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 01:10:28 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 01:13:57 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 01:17:25 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 01:20:54 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 01:24:23 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 01:27:51 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 01:31:20 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 01:34:48 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 01:38:17 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 01:41:46 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 01:45:14 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 01:48:43 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 01:52:12 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 01:55:40 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 01:59:09 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 02:02:38 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 02:06:06 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 02:09:35 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 02:13:04 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 02:16:32 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 02:20:01 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 02:26:58 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 02:30:27 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "01/22/2022 02:33:56 - ERROR - huggingface_hub.repository - Waiting for the following commands to finish before shutting down: [[push command, status code: running, in progress. PID: 776656]].\n", "^C\n", "Error in atexit._run_exitfuncs:\n", "Traceback (most recent call last):\n", " File \"/opt/conda/lib/python3.8/site-packages/huggingface_hub/repository.py\", line 878, in lfs_prune\n", " logger.info(result.stdout)\n", " File \"/opt/conda/lib/python3.8/contextlib.py\", line 120, in __exit__\n", " next(self.gen)\n", " File \"/opt/conda/lib/python3.8/site-packages/huggingface_hub/repository.py\", line 343, in lfs_log_progress\n", " x.join()\n", " File \"/opt/conda/lib/python3.8/threading.py\", line 1011, in join\n", " self._wait_for_tstate_lock()\n", " File \"/opt/conda/lib/python3.8/threading.py\", line 1027, in _wait_for_tstate_lock\n", " elif lock.acquire(block, timeout):\n", "KeyboardInterrupt\n" ] } ], "source": [ "!python run_speech_recognition_ctc.py \\\n", "\t--dataset_name=\"mozilla-foundation/common_voice_7_0\" \\\n", "\t--model_name_or_path=\"facebook/wav2vec2-xls-r-300m\" \\\n", "\t--dataset_config_name=\"hi\" \\\n", "\t--output_dir=\"./wav2vec2-large-xls-r-300m-hindi\" \\\n", "\t--overwrite_output_dir \\\n", "\t--num_train_epochs=\"100\" \\\n", "\t--per_device_train_batch_size=\"32\" \\\n", "\t--per_device_eval_batch_size=\"32\" \\\n", "\t--gradient_accumulation_steps=\"1\" \\\n", "\t--learning_rate=\"7.5e-5\" \\\n", "\t--warmup_steps=\"2000\" \\\n", "\t--length_column_name=\"input_length\" \\\n", "\t--evaluation_strategy=\"steps\" \\\n", "\t--text_column_name=\"sentence\" \\\n", "\t--chars_to_ignore , ? . ! \\- \\; \\: \\\" “ % ‘ ” � — \\’ … \\– \\' \\’ \\– � \\' \\’ \\– \\& a-z A-Z \\। \\\n", "\t--save_steps=\"500\" \\\n", "\t--eval_steps=\"500\" \\\n", "\t--logging_steps=\"100\" \\\n", "\t--layerdrop=\"0.0\" \\\n", "\t--activation_dropout=\"0.1\" \\\n", "\t--save_total_limit=\"3\" \\\n", "\t--freeze_feature_encoder \\\n", "\t--feat_proj_dropout=\"0.0\" \\\n", "\t--mask_time_prob=\"0.75\" \\\n", "\t--mask_time_length=\"10\" \\\n", "\t--mask_feature_prob=\"0.25\" \\\n", "\t--mask_feature_length=\"64\" \\\n", "\t--gradient_checkpointing \\\n", "\t--use_auth_token \\\n", "\t--fp16 \\\n", "\t--group_by_length \\\n", "\t--do_train --do_eval \\\n", " --push_to_hub" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import pandas as pd\n", "\n", "df = pd.DataFrame([\n", " {}\n", "])" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "# !zip -r wav2vec2-large-xls-r-300m-odia.zip wav2vec2-large-xls-r-300m-odia/\n", "# !rm wav2vec2-large-xls-r-300m-odia.zip" ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "collapsed": true, "jupyter": { "outputs_hidden": true } }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Filesystem Size Used Avail Use% Mounted on\n", "overlay 3.5T 557G 2.8T 17% /\n", "tmpfs 64M 0 64M 0% /dev\n", "tmpfs 87G 0 87G 0% /sys/fs/cgroup\n", "tmpfs 87G 0 87G 0% /dev/shm\n", "/dev/md0 3.5T 557G 2.8T 17% /etc/group\n", "tmpfs 87G 12K 87G 1% /proc/driver/nvidia\n", "/dev/vda1 49G 6.6G 42G 14% /usr/bin/nvidia-smi\n", "udev 87G 0 87G 0% /dev/nvidia0\n", "tmpfs 87G 0 87G 0% /proc/acpi\n", "tmpfs 87G 0 87G 0% /proc/scsi\n", "tmpfs 87G 0 87G 0% /sys/firmware\n" ] } ], "source": [ "!df -h" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "Reusing dataset common_voice (/workspace/.cache/huggingface/datasets/mozilla-foundation___common_voice/hi/7.0.0/33e08856cfa0d0665e837bcad73ffd920a0bc713ce8c5fffb55dbdf1c084d5ba)\n", "Reusing dataset common_voice (/workspace/.cache/huggingface/datasets/mozilla-foundation___common_voice/hi/7.0.0/33e08856cfa0d0665e837bcad73ffd920a0bc713ce8c5fffb55dbdf1c084d5ba)\n" ] } ], "source": [ "from datasets import load_dataset, load_metric, Audio\n", "\n", "common_voice_train = load_dataset(\"mozilla-foundation/common_voice_7_0\", \"hi\", use_auth_token=True, split=\"train+validation\")\n", "common_voice_test = load_dataset(\"mozilla-foundation/common_voice_7_0\", \"hi\", use_auth_token=True, split=\"test\")" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "7360.9375" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "len(common_voice_train) * 50 / 32" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "common_voice_train = common_voice_train.remove_columns([\"accent\", \"age\", \"client_id\", \"down_votes\", \"gender\", \"locale\", \"segment\", \"up_votes\"])\n", "common_voice_test = common_voice_test.remove_columns([\"accent\", \"age\", \"client_id\", \"down_votes\", \"gender\", \"locale\", \"segment\", \"up_votes\"])" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "from datasets import ClassLabel\n", "import random\n", "import pandas as pd\n", "from IPython.display import display, HTML\n", "\n", "def show_random_elements(dataset, num_examples=10):\n", " assert num_examples <= len(dataset), \"Can't pick more elements than there are in the dataset.\"\n", " picks = []\n", " for _ in range(num_examples):\n", " pick = random.randint(0, len(dataset)-1)\n", " while pick in picks:\n", " pick = random.randint(0, len(dataset)-1)\n", " picks.append(pick)\n", " \n", " df = pd.DataFrame(dataset[picks])\n", " display(HTML(df.to_html()))" ] }, { "cell_type": "code", "execution_count": 32, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\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", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
sentence
0रोज़ेटा यूरोपीय अंतरिक्ष एजेंसी ने बनाया था
1आप थोड़ा धीरे बोल सकते हैं क्या
2पाक में बाढ़ की स्थिति का फायदा उठा सकते हैं चरमपंथीअमेरिका
3दिल्ली पुलिस के हत्थे चढ़ा माओवादियों का कारतूस सप्लायर
4यूपी में बंदर बना ड्राइवर दो गाड़ियों में मारी टक्कर
5उत्तराखंड सरकारी कार्यालयों में सिंगल यूज प्लास्टिक पर लगेगा प्रतिबंध
6वही तो
7उसेन बोल्ट का गेंदबाजी एक्शन देखकर हैरान रह गयाः हरभजन सिंह
8इटली एक बहुत सुंदर देश है
9तुम्हारी बंदूक कहाँ है
" ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "show_random_elements(common_voice_train.remove_columns([\"path\", \"audio\"]), num_examples=10)" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [], "source": [ "import re\n", "chars_to_remove_regex = '[\\,\\?\\.\\!\\-\\;\\:\\\"\\“\\%\\‘\\”\\�\\'\\’\\–\\&a-zA-Z\\।]'\n", "\n", "def remove_special_characters(batch):\n", " batch[\"sentence\"] = re.sub(chars_to_remove_regex, '', batch[\"sentence\"]).lower()\n", " return batch" ] }, { "cell_type": "code", "execution_count": 19, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "3910ff24d244410b96941c17b57935c2", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/4711 [00:00] 4.32K --.-KB/s in 0s \n", "\n", "2022-01-22 02:39:02 (11.4 MB/s) - ‘eval.py’ saved [4419/4419]\n", "\n", "total 1232728\n", "drwxr-xr-x 5 ovh ovh 4096 Jan 21 17:29 runs\n", "-rw-r--r-- 1 ovh ovh 23 Jan 21 17:29 added_tokens.json\n", "-rw-r--r-- 1 ovh ovh 771 Jan 21 17:29 vocab.json\n", "-rw-r--r-- 1 ovh ovh 260 Jan 21 17:29 tokenizer_config.json\n", "-rw-r--r-- 1 ovh ovh 309 Jan 21 17:29 special_tokens_map.json\n", "drwxr-xr-x 2 ovh ovh 4096 Jan 21 23:40 checkpoint-13500\n", "drwxr-xr-x 2 ovh ovh 4096 Jan 21 23:53 checkpoint-14000\n", "drwxr-xr-x 2 ovh ovh 4096 Jan 22 00:06 checkpoint-14500\n", "-rw-r--r-- 1 ovh ovh 197 Jan 22 00:13 train_results.json\n", "-rw-r--r-- 1 ovh ovh 25203 Jan 22 00:13 trainer_state.json\n", "-rw-r--r-- 1 ovh ovh 225 Jan 22 00:15 eval_results.json\n", "-rw-r--r-- 1 ovh ovh 2033 Jan 22 00:15 config.json\n", "-rw-r--r-- 1 ovh ovh 400 Jan 22 00:15 all_results.json\n", "-rw-r--r-- 1 ovh ovh 1262210673 Jan 22 00:15 pytorch_model.bin\n", "-rw-r--r-- 1 ovh ovh 3055 Jan 22 00:15 training_args.bin\n", "-rw-r--r-- 1 ovh ovh 212 Jan 22 00:15 preprocessor_config.json\n", "-rw-r--r-- 1 ovh ovh 3291 Jan 22 00:17 README.md\n", "-rw-r--r-- 1 ovh ovh 4419 Jan 22 02:39 eval.py\n" ] } ], "source": [ "!wget -O eval.py https://raw.githubusercontent.com/huggingface/transformers/master/examples/research_projects/robust-speech-event/eval.py\n", "!cp eval.py wav2vec2-large-xls-r-300m-hindi\n", "!ls -ltr wav2vec2-large-xls-r-300m-hindi" ] }, { "cell_type": "code", "execution_count": 36, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Reusing dataset common_voice (/workspace/.cache/huggingface/datasets/mozilla-foundation___common_voice/hi/7.0.0/33e08856cfa0d0665e837bcad73ffd920a0bc713ce8c5fffb55dbdf1c084d5ba)\n", "100%|███████████████████████████████████████████| 10/10 [00:05<00:00, 1.99ex/s]\n", "WER: 1.0166666666666666\n", "CER: 1.0327272727272727\n", "100%|████████████████████████████████████████| 10/10 [00:00<00:00, 12905.55ex/s]\n" ] } ], "source": [ "!cd wav2vec2-large-xls-r-300m-hindi; python eval.py --model_id ./ --dataset mozilla-foundation/common_voice_7_0 --config hi --split test --log_outputs" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "accelerator": "GPU", "colab": { "authorship_tag": "ABX9TyM3OaMlm9YQtKpl28c8gBBd", "include_colab_link": true, "name": "DebugOVHTransformers.ipynb", "provenance": [] }, "kernelspec": { "display_name": "Python 3", "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.8" } }, "nbformat": 4, "nbformat_minor": 4 }