{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import os\n", "\n", "os.environ[\"CUDA_VISIBLE_DEVICES\"] = \"0\"" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "63594f228ab14d9796bbf24112269a52", "version_major": 2, "version_minor": 0 }, "text/plain": [ "VBox(children=(HTML(value='
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", "\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\n", "data_collator = DataCollatorSpeechSeq2SeqWithPadding(processor=processor)" ] }, { "cell_type": "code", "execution_count": 44, "metadata": {}, "outputs": [], "source": [ "from transformers import WhisperForConditionalGeneration\n", "\n", "\n", "model = WhisperForConditionalGeneration.from_pretrained(\n", " model_name_or_path, device_map=\"auto\"\n", ")" ] }, { "cell_type": "code", "execution_count": 27, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "DatasetDict({\n", " test: Dataset({\n", " features: ['input_features', 'labels'],\n", " num_rows: 857\n", " })\n", "})" ] }, "execution_count": 27, "metadata": {}, "output_type": "execute_result" } ], "source": [ "evaluation_dataset" ] }, { "cell_type": "code", "execution_count": 34, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "100%|██████████| 108/108 [09:19<00:00, 5.18s/it]" ] }, { "name": "stdout", "output_type": "stream", "text": [ "wer=24.938214396045723\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\n" ] } ], "source": [ "from torch.utils.data import DataLoader\n", "from tqdm import tqdm\n", "import numpy as np\n", "import gc\n", "import evaluate\n", "metric = evaluate.load(\"wer\")\n", "eval_dataloader = DataLoader(evaluation_dataset['test'], batch_size=8, collate_fn=data_collator)\n", "\n", "model.eval()\n", "for step, batch in enumerate(tqdm(eval_dataloader)):\n", " with torch.cuda.amp.autocast():\n", " with torch.no_grad():\n", " generated_tokens = (\n", " model.generate(\n", " input_features=batch[\"input_features\"].to(\"cuda\"),\n", " decoder_input_ids=batch[\"labels\"][:, :4].to(\"cuda\"),\n", " max_new_tokens=255,\n", " )\n", " .cpu()\n", " .numpy()\n", " )\n", " labels = batch[\"labels\"].cpu().numpy()\n", " labels = np.where(labels != -100, labels, tokenizer.pad_token_id)\n", " decoded_preds = tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)\n", " decoded_labels = tokenizer.batch_decode(labels, skip_special_tokens=True)\n", " metric.add_batch(\n", " predictions=decoded_preds,\n", " references=decoded_labels,\n", " )\n", " del generated_tokens, labels, batch\n", " gc.collect()\n", "wer = 100 * metric.compute()\n", "print(f\"{wer=}\")" ] }, { "cell_type": "code", "execution_count": 46, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "100%|██████████| 54/54 [07:20<00:00, 8.15s/it]" ] }, { "name": "stdout", "output_type": "stream", "text": [ "wer=24.934352795798578 and normalized_wer=13.639508070714834\n", "{'eval/wer': 24.934352795798578, 'eval/normalized_wer': 13.639508070714834}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\n" ] } ], "source": [ "import gc\n", "import numpy as np\n", "from tqdm import tqdm\n", "from torch.utils.data import DataLoader\n", "from transformers.models.whisper.english_normalizer import BasicTextNormalizer\n", "\n", "eval_dataloader = DataLoader(evaluation_dataset['test'], batch_size=16, collate_fn=data_collator)\n", "forced_decoder_ids = processor.get_decoder_prompt_ids(language=language, task='transcribe')\n", "normalizer = BasicTextNormalizer()\n", "\n", "predictions = []\n", "references = []\n", "normalized_predictions = []\n", "normalized_references = []\n", "import evaluate\n", "metric = evaluate.load(\"wer\")\n", "model.eval()\n", "for step, batch in enumerate(tqdm(eval_dataloader)):\n", " with torch.cuda.amp.autocast():\n", " with torch.no_grad():\n", " generated_tokens = (\n", " model.generate(\n", " input_features=batch[\"input_features\"].to(\"cuda\"),\n", " forced_decoder_ids=forced_decoder_ids,\n", " max_new_tokens=255,\n", " )\n", " .cpu()\n", " .numpy()\n", " )\n", " labels = batch[\"labels\"].cpu().numpy()\n", " labels = np.where(labels != -100, labels, processor.tokenizer.pad_token_id)\n", " decoded_preds = processor.tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)\n", " decoded_labels = processor.tokenizer.batch_decode(labels, skip_special_tokens=True)\n", " predictions.extend(decoded_preds)\n", " references.extend(decoded_labels)\n", " normalized_predictions.extend([normalizer(pred).strip() for pred in decoded_preds])\n", " normalized_references.extend([normalizer(label).strip() for label in decoded_labels])\n", " del generated_tokens, labels, batch\n", " gc.collect()\n", "wer = 100 * metric.compute(predictions=predictions, references=references)\n", "normalized_wer = 100 * metric.compute(predictions=normalized_predictions, references=normalized_references)\n", "eval_metrics = {\"eval/wer\": wer, \"eval/normalized_wer\": normalized_wer}\n", "\n", "print(f\"{wer=} and {normalized_wer=}\")\n", "print(eval_metrics)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Lora\n" ] }, { "cell_type": "code", "execution_count": 47, "metadata": {}, "outputs": [], "source": [ "import torch\n", "\n", "from dataclasses import dataclass\n", "from typing import Any, Dict, List, Union\n", "\n", "@dataclass\n", "class DataCollatorSpeechSeq2SeqWithPadding:\n", " processor: Any\n", "\n", " def __call__(self, features: List[Dict[str, Union[List[int], torch.Tensor]]]) -> 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", "\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": "code", "execution_count": 48, "metadata": {}, "outputs": [], "source": [ "import torch\n", "from transformers import (\n", " AutomaticSpeechRecognitionPipeline,\n", " WhisperForConditionalGeneration,\n", " WhisperTokenizer,\n", " WhisperProcessor,\n", ")\n", "from peft import PeftModel, PeftConfig\n", "\n", "peft_model_id = \"DuyTa/vi-whisper-medium-Lora\"\n", "\n", "language = \"Vietnamese\"\n", "task = \"transcribe\"\n", "\n", "peft_config = PeftConfig.from_pretrained(peft_model_id)\n", "model = WhisperForConditionalGeneration.from_pretrained(\n", " peft_config.base_model_name_or_path,\n", ")\n", "model = PeftModel.from_pretrained(model, peft_model_id)\n", "model.to(\"cuda\").half()\n", "\n", "processor = WhisperProcessor.from_pretrained(peft_config.base_model_name_or_path, language=language, task=task)\n", "\n" ] }, { "cell_type": "code", "execution_count": 49, "metadata": {}, "outputs": [], "source": [ "data_collator = DataCollatorSpeechSeq2SeqWithPadding(processor=processor)" ] }, { "cell_type": "code", "execution_count": 41, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "100%|██████████| 108/108 [12:31<00:00, 6.96s/it]" ] }, { "name": "stdout", "output_type": "stream", "text": [ "wer_lora=24.934352795798578\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\n" ] } ], "source": [ "from torch.utils.data import DataLoader\n", "from tqdm import tqdm\n", "import numpy as np\n", "import gc\n", "import evaluate\n", "metric = evaluate.load(\"wer\")\n", "eval_dataloader = DataLoader(evaluation_dataset['test'], batch_size=8, collate_fn=data_collator)\n", "\n", "model.eval()\n", "for step, batch in enumerate(tqdm(eval_dataloader)):\n", " with torch.cuda.amp.autocast():\n", " with torch.no_grad():\n", " generated_tokens = (\n", " model.generate(\n", " input_features=batch[\"input_features\"].to(\"cuda\"),\n", " decoder_input_ids=batch[\"labels\"][:, :4].to(\"cuda\"),\n", " max_new_tokens=255,\n", " )\n", " .cpu()\n", " .numpy()\n", " )\n", " labels = batch[\"labels\"].cpu().numpy()\n", " labels = np.where(labels != -100, labels, tokenizer.pad_token_id)\n", " decoded_preds = tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)\n", " decoded_labels = tokenizer.batch_decode(labels, skip_special_tokens=True)\n", " metric.add_batch(\n", " predictions=decoded_preds,\n", " references=decoded_labels,\n", " )\n", " del generated_tokens, labels, batch\n", " gc.collect()\n", "wer_lora = 100 * metric.compute()\n", "print(f\"{wer_lora=}\")" ] }, { "cell_type": "code", "execution_count": 50, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "100%|██████████| 54/54 [09:20<00:00, 10.39s/it]" ] }, { "name": "stdout", "output_type": "stream", "text": [ "wer=24.934352795798578 and normalized_wer=13.624135280553421\n", "{'eval/wer': 24.934352795798578, 'eval/normalized_wer': 13.624135280553421}\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "\n" ] } ], "source": [ "import gc\n", "import numpy as np\n", "from tqdm import tqdm\n", "from torch.utils.data import DataLoader\n", "from transformers.models.whisper.english_normalizer import BasicTextNormalizer\n", "\n", "eval_dataloader = DataLoader(evaluation_dataset['test'], batch_size=16, collate_fn=data_collator)\n", "forced_decoder_ids = processor.get_decoder_prompt_ids(language=language, task='transcribe')\n", "normalizer = BasicTextNormalizer()\n", "\n", "predictions = []\n", "references = []\n", "normalized_predictions = []\n", "normalized_references = []\n", "import evaluate\n", "metric = evaluate.load(\"wer\")\n", "model.eval()\n", "for step, batch in enumerate(tqdm(eval_dataloader)):\n", " with torch.cuda.amp.autocast():\n", " with torch.no_grad():\n", " generated_tokens = (\n", " model.generate(\n", " input_features=batch[\"input_features\"].to(\"cuda\"),\n", " forced_decoder_ids=forced_decoder_ids,\n", " max_new_tokens=255,\n", " )\n", " .cpu()\n", " .numpy()\n", " )\n", " labels = batch[\"labels\"].cpu().numpy()\n", " labels = np.where(labels != -100, labels, processor.tokenizer.pad_token_id)\n", " decoded_preds = processor.tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)\n", " decoded_labels = processor.tokenizer.batch_decode(labels, skip_special_tokens=True)\n", " predictions.extend(decoded_preds)\n", " references.extend(decoded_labels)\n", " normalized_predictions.extend([normalizer(pred).strip() for pred in decoded_preds])\n", " normalized_references.extend([normalizer(label).strip() for label in decoded_labels])\n", " del generated_tokens, labels, batch\n", " gc.collect()\n", "wer = 100 * metric.compute(predictions=predictions, references=references)\n", "normalized_wer = 100 * metric.compute(predictions=normalized_predictions, references=normalized_references)\n", "eval_metrics = {\"eval/wer\": wer, \"eval/normalized_wer\": normalized_wer}\n", "\n", "print(f\"{wer=} and {normalized_wer=}\")\n", "print(eval_metrics)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Quantization Whisper Lora" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "from whisper_quant import WhisperModel\n", "\n", "model_size = \"medium\"\n", "\n", "# Run on GPU with FP16\n", "model = WhisperModel(model_size, device=\"cuda\", compute_type=\"float16\")\n", "\n", "# or run on GPU with INT8\n", "# model = WhisperModel(model_size, device=\"cuda\", compute_type=\"int8_float16\")\n", "# or run on CPU with INT8\n", "# model = WhisperModel(model_size, device=\"cpu\", compute_type=\"int8\")\n", "\n" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [], "source": [ "segments, info = model.transcribe(\"audio.wav\", beam_size=1, language ='vi', temperature= 0)\n" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[0.00s -> 7.10s] Hai, đây tức là một kẻ ăn mày vậy, anh ta chưa kịp quay đi thì đã thấy mấy con chó vàng chạy sồng sộc ra cứ nhảy sổ vào chân anh.\n" ] } ], "source": [ "for segment in segments:\n", " print(\"[%.2fs -> %.2fs] %s\" % (segment.start, segment.end, segment.text))" ] }, { "cell_type": "code", "execution_count": 56, "metadata": {}, "outputs": [], "source": [ "normalizer = BasicTextNormalizer()\n", "norm = normalizer(segment.text)" ] }, { "cell_type": "code", "execution_count": 57, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "' hai đây tức là một kẻ ăn mầy vậy anh ta chưa kịp quay đi thì đã thấy mấy con chó vàng chạy sồng sộc ra cứ nhảy sổ vào chân anh '" ] }, "execution_count": 57, "metadata": {}, "output_type": "execute_result" } ], "source": [ "norm" ] }, { "cell_type": "code", "execution_count": 119, "metadata": {}, "outputs": [], "source": [ "import torch\n", "from dataclasses import dataclass\n", "\n", "@dataclass\n", "class DataCollatorSpeechSeq2SeqWithPadding:\n", " processor: Any\n", "\n", " def __call__(self, features):\n", " audios = []\n", " for feature in features:\n", " audios.append(feature[\"audio\"])\n", " batch = {\n", " \"audio\": [feature[\"audio\"]['array'] for feature in features],\n", " \"transcription\": [feature[\"transcription\"] for feature in features]\n", " }\n", " return batch\n", "data_collator = DataCollatorSpeechSeq2SeqWithPadding(processor='No')" ] }, { "cell_type": "code", "execution_count": 120, "metadata": {}, "outputs": [], "source": [ "from torch.utils.data import DataLoader\n", "from tqdm import tqdm\n", "import numpy as np\n", "import gc\n", "import evaluate\n", "metric = evaluate.load(\"wer\")\n", "eval_dataloader = DataLoader(fleurs['test'], batch_size=16, collate_fn=data_collator)\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import re\n", "for data in eval_dataloader:\n", " audios = data['audio']\n", " transcriptions = data['transcription']\n", " final = []\n", " for audio in data['audio']:\n", " print(\"-\" * 20)\n", " segments, info = model.transcribe(audio, beam_size=1, language='vi')\n", " out = [out.text for out in segments]\n", " pred = ''.join(out)\n", " norm_pred = normalizer(pred)\n", " final.append(norm_pred)\n", "cleaned_text_list = [re.sub(r'\\s+', ' ', text.strip()) for text in final]\n", " \n", "\n", " print(cleaned_text_list)\n", " print(transcriptions)\n", " break\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for step, batch in enumerate(tqdm(eval_dataloader)):\n", " with torch.cuda.amp.autocast():\n", " with torch.no_grad():\n", "\n", " labels = batch[\"transcription\"]\n", " print(labels)" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "for step, batch in enumerate(tqdm(eval_dataloader)):\n", " with torch.cuda.amp.autocast():\n", " with torch.no_grad():\n", " final = []\n", " labels = batch[\"transcription\"]\n", " for audio in batch[\"audio\"]:\n", " \n", " segments, _ = model.transcribe(audio, beam_size=1, language='vi')\n", " out = [out.text for out in segments]\n", " pred = ''.join(out)\n", " norm_pred = normalizer(pred)\n", " final.append(norm_pred)\n", " cleaned_text_list = [re.sub(r'\\s+', ' ', text.strip()) for text in final]\n", " print(cleaned_text_list)\n", " print(labels)\n", " metric.add_batch(\n", " predictions=cleaned_text_list,\n", " references=labels,\n", " )\n", " del labels, batch, final\n", " gc.collect()\n", "wer_lora = 100 * metric.compute()\n", "print(f\"{wer_lora=}\")" ] }, { "cell_type": "code", "execution_count": 39, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjIAAAHHCAYAAACle7JuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjc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i1u2rRJxhj169evwLj84Qu/lEvLGKOzZ8/K19f3spaTr3v37mrVqlWp5vn999+Vl5enSpUqFRiXlZVV5C/tkijJ9nl7e+u+++6zhh966CG1a9dOixcv1vPPP6/q1atf8vrLWkJCgtq3b69rrrnGauvQoYNeffVVbdy4Ud27d7fak5OT1b9/f7311lvatm2bbrzxRmvchg0b1LRpUwUEBLgsv6SfX7169VzeszvuuEONGjXSnDlzXIKMJPXv318zZszQ2rVr1blz51Jvc2HS0tIkScHBwSWep0ePHnrvvff0r3/9S97e//fPwltvvaWWLVvql19+KZPagPLAqSV4vA4dOuirr77SmTNnrLbk5GQ1btxY3bt31+bNm5WXl+cyzuFwqH379pL+CANTpkxRnTp15HQ6FR0drX/84x8F+iZER0erV69eWrlypVq1aiVfX1/rsP/hw4fVt29f+fv7KywsTGPGjCnzvg355/6fe+45zZ4926o3/3SMw+HQzp07dc8996hKlSpWUCuL7Ssph8OhDh06yBijH3/80Wo/ePCgHnroIdWvX1++vr4KDQ1Vv379XE4hJSYmql+/fpKkTp06Wac0zu9jtHz5ct10003y9/dXQECAevbsqe++++6idZ09e1YrVqwocAQi/z1KTk52mXb79u26/fbbVbt2bZdxx48f1549ey47BJ+vYcOGqlq1qvbt21dgXMuWLRUSEqKPPvqoRMt677331LJlS/n6+qpq1aq67777dOTIEWt8bGys4uLiJEmtW7eWw+HQoEGDLrrcAQMG6Ndff9Xq1auttpycHL3//vu65557Cp0nKytL48aNU2RkpJxOp+rXr6/nnntOxhiX6bKzszVmzBhVq1ZNAQEBuvXWW3X48OFCl3nkyBH97W9/U/Xq1eV0OtW4cWO9/vrrF63/6NGjGjx4sK699lo5nU6Fh4erT58+5XIKE56HIzLweB06dNDChQu1ZcsWxcbGSvrjH6Z27dqpXbt2Sk9P17fffqumTZta4xo0aKDQ0FBJ0gMPPKA33nhDd955p8aNG6ctW7YoPj5eu3btKtD3Zvfu3RowYICGDx+uoUOHqn79+jpz5oxuvvlmHTp0SKNGjVJERIQWLlyozz//vFTbkZ6eXuCXrcPhsOrMl5CQoLNnz2rYsGFyOp0KCQmxxvXr109169bV1KlTrX8wLnf7Siv/H4cqVapYbSkpKdq4caPuvvtuXXvttTpw4IDmz5+v2NhY7dy5U35+furYsaNGjRqlf/3rX/rHP/6hhg0bSpL134ULFyouLk5du3bV9OnTdfr0ac2fP98KssWditq2bZtycnLUokULl/batWsrIiLC5ahdSkqKcnJyrP0nOTlZ48aNkyRt3LhRUuFH80r6+RU234kTJ1SnTp1Cx7do0cIlTBUlMTFRgwcPVuvWrRUfH69jx45pzpw5Sk5O1ldffaXg4GA9+eSTql+/vl555RXrVFhR6z1fdHS02rZtq8WLF1tHrpYvX6709HTdfffd+te//uUyvTFGt956q9auXashQ4aoefPmWrlypR577DEdOXJEL7zwgjXtAw88oDfffFP33HOP2rVrp88//1w9e/YsUMOxY8d04403yuFwaOTIkapWrZqWL1+uIUOGKCMjQ6NHjy6y/jvuuEPfffedHn74YUVHRystLU2rV6/WoUOHyvwUJjyQATzcd999ZySZKVOmGGOMOXfunPH39zdvvPGGMcaY6tWrm3nz5hljjMnIyDBeXl5m6NChxhhjduzYYSSZBx54wGWZjz76qJFkPv/8c6stKirKSDIrVqxwmXb27NlGknn33XettqysLHPdddcZSWbt2rXF1p+QkGAkFfpyOp3WdPv37zeSTGBgoElLS3NZxsSJE40kM2DAAJf2sti+osTFxRl/f39z/Phxc/z4cbN3717z3HPPGYfDYa6//nqTl5dnTXv69OkC82/atMlIMv/5z3+stvfee6/Q9ywzM9MEBwdbn1u+o0ePmqCgoALtF1qwYIGRZL755psC4/r162d8fX1NTk6OMcaY+Ph4U6tWLWOMMS+++KIJCwuzps1/344cOWK1lfTzM8YYSWbIkCHm+PHjJi0tzWzdutV069bNSDIzZ84stPZhw4YZX1/fYrcvJyfHhIWFmeuvv96cOXPGal+2bJmRZCZMmFCg3pSUlGKXeeG0c+fONQEBAdZn2a9fP9OpUydjzB/7Ts+ePa35li5daiSZZ555xmV5d955p3E4HGbv3r3GmP/b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24sp9NZlrUBAAAUq1RB5sCBA5o/f77efvttHT58WMYYa1ylSpV00003adiwYbrjjjtUoQIHewAAQPkqcdoYNWqUmjVrpv379+uZZ57Rzp07lZ6erpycHB09elSfffaZOnTooAkTJqhp06ZKSUkpz7oBAABKfkTG399fP/74o0JDQwuMCwsLU+fOndW5c2dNnDhRK1asUGpqqlq3bl2mxQIAAJyvxEEmPj6+xAvt1q3bJRUDAABQGpfc2TffL7/8oi1btig3N1etW7dWeHh4WdQFAABwUZcVZD744AMNGTJE9erV07lz57R7927NmzdPgwcPLqv6AAAAilSqS4tOnTrlMjx58mR9+eWX+vLLL/XVV1/pvffe05NPPlmmBQIAABSlVEGmZcuW+uijj6xhb29vpaWlWcPHjh1TpUqVyq46AACAYpTq1NLKlSs1YsQIJSYmat68eZozZ47uuusu5ebm6vfff1eFChWUmJhYTqUCAAC4KlWQiY6O1qeffqrFixcrJiZGo0aN0t69e7V3717l5uaqQYMG8vHxKa9aAQAAXFzS7XcHDBiglJQUff3114qNjVVeXp6aN29OiAEAAFdUqYPMZ599plmzZmnr1q1asGCBZsyYoXvvvVePPfaYzpw5U6bF5ebm6umnn1atWrXk6+urOnXqaMqUKS6PRgAAAFevUgWZcePGafDgwUpJSdHw4cM1ZcoUxcTEaPv27fLx8dENN9yg5cuXl1lx06dP1/z58zV37lzt2rVL06dP14wZM/Tvf/+7zNYBAADsy2FKcXgjNDRUq1atUsuWLfXbb7/pxhtv1J49e6zxO3fu1PDhw7V+/foyKa5Xr16qXr26XnvtNavtjjvukK+vr958880SLSMjI0NBQUFKT09XYGBgmdSVz+Eo08XBhtx9cNAxmZ3wamcmesARar4Mr27l9EVY0n+/S3VExt/fX/v375ckpaamFugT06hRozILMZLUrl07rVmzxgpLX3/9tTZs2KDu3buX2ToAAIB9leqqpfj4eA0cOFCjRo3S6dOn9cYbb5RXXZKkJ554QhkZGWrQoIG8vLyUm5urZ599Vvfee2+R82RnZys7O9sazsjIKNcaAQCA+5QqyNx7773q1q2bfvz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GhyMhInrWEcuHuvx6etQSetQS3s/OzlspbeHi4GjVq5NLWsGFDHTp0qMh5nE6nAgMDXV4AAODPyaODTPv27bV7926Xtj179igqKspNFQEAAE/i0UFmzJgx2rx5s6ZOnaq9e/fqrbfe0iuvvKIRI0a4uzQAAOABPDrItG7dWkuWLNHixYt1/fXXa8qUKZo9e7buvfded5cGAAA8gEffR0aSevXqpV69erm7DAAA4IE8+ogMAABAcQgyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtggyAADAtmwVZKZNmyaHw6HRo0e7uxQAAOABbBNkUlJS9PLLL6tp06buLgUAAHgIWwSZU6dO6d5779Wrr76qKlWquLscAADgIWwRZEaMGKGePXuqS5cuF502OztbGRkZLi8AAPDn5O3uAi7m7bff1vbt25WSklKi6ePj4zV58uRyrgoAAHgCjz4ik5qaqkceeUSLFi2Sj49PieYZP3680tPTrVdqamo5VwkAANzFo4/IbNu2TWlpaWrRooXVlpubqy+++EJz585Vdna2vLy8XOZxOp1yOp1XulQAAOAGHh1kbr75Zn3zzTcubYMHD1aDBg30+OOPFwgxAADg6uLRQSYgIEDXX3+9S5u/v79CQ0MLtAMAgKuPR/eRAQAAKI5HH5EpTFJSkrtLAAAAHoIjMgAAwLYIMgAAwLYIMgAAwLYIMgAAwLYIMgAAwLYIMgAAwLYIMgAAwLYIMgAAwLYIMgAAwLYIMgAAwLYIMgAAwLYIMgAAwLYIMgAAwLYIMgAAwLYIMgAAwLYIMgAAwLYIMgAAwLYIMgAAwLYIMgAAwLYIMgAAwLYIMgAAwLYIMgAAwLYIMgAAwLYIMgAAwLYIMgAAwLYIMgAAwLYIMgAAwLYI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rfvr0mTJigqKgoLVmyRGPHjpX0R4o/c+aMfH19JUmbN29W5cqVFRkZqZCQEKvT1oW/NIpz3XXXXXK952vRooWOHj0qb29vRUdHFzpNw4YNtWXLFg0cONBq27x5c7HLrVatmksH04yMDO3fv79Mar4aXW37b2BgoCIiIpScnOyy3OTkZP3lL38pdt7k5GT16dPH6vycl5enPXv2qFGjRiWuzy7q1KmjihUrasuWLapZs6akPzqN7tmzx3rfLvxb/OGHH3T69GlreOPGjYqKitKTTz5ptR08eLDUtVSqVMnq25Lv7Nmz6tOnjxo0aKDnn3/eZVxISIhCQkIKLCcmJkavv/66vL291a1bN0l/7OuLFy/Wnj17XPrHXApfX1/17t1bvXv31ogRI9SgQQN98803atGihaSC322bN29Ww4YNJZXs+7Kw9V1sf2/YsKF+//13bdmyRe3atZMk/frrr9q9e/dF99vk5GS9+OKL6tGjhyQpNTVVv/zyS4lqK2sEmXJWpUoVNW3aVIsWLdLcuXMlSR07dlT//v117ty5Un0Jn2/Lli1as2aN/vrXvyosLExbtmzR8ePHrR1f+uPyuyFDhuipp57SgQMHNHHiRI0cOVIVKlRQQECAHn30UY0ZM0Z5eXnq0KGD0tPTlZycrMDAQMXFxZXJ9helS5cuatu2rfr27asZM2aoXr16+umnn/Tpp5/qtttuU6tWrfTII49o0KBBatWqldq3b69Fixbpu+++U+3atYtcbufOnZWYmKjevXsrODhYEyZMcDn8i9K5Gvffxx57TBMnTlSdOnXUvHlzJSQkaMeOHYUemj9f3bp19f7772vjxo2qUqWKnn/+eR07duxPGWQqV66sIUOG6LHHHlNoaKjCwsL05JNPupxK7ty5s+bOnau2bdsqNzdXjz/+uMvRh7p16+rQoUN6++231bp1a3366adasmRJqWuJjo7Wli1bdODAAVWuXFkhISEaPny4UlNTtWbNGh0/ftyaNiQkpMhLkjt27KjMzEwtW7bM6kwcGxurO++8U+Hh4apXr16pa8uXmJio3NxctWnTRn5+fnrzzTfl6+urqKgoa5rk5GTNmDFDffv21erVq/Xee+/p008/lVSy78t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aNWqUFi5cqHbt2um3337T+vXry2szAJQjggyAK27ZsmWqXLmyNdy9e3e99957LtMcOnRICQkJOnTokCIiIiT98aTjFStWKCEhQVOnTi3x+vz9/bVgwQLrlNKHH34of39/9erVSwEBAYqKitINN9xQBlsG4EojyAC44jp16qT58+dbw/7+/gWm+eabb5Sbm6t69eq5tGdnZys0NLRU62vSpIlLv5hbbrlFUVFRql27trp166Zu3brptttuk5+fXym3BIC7EWQAXHH+/v667rrrip3m1KlT8vLy0rZt2wr0n8k/mlOhQgVd+Li4c+fOFbq+8wUEBGj79u1KSkrSqlWrNGHCBE2aNEkpKSkKDg6+hC0C4C4EGQAe6YYbblBubq7S0tJ00003FTpNtWrVdPToURlj5HA4JEk7duwo0fK9vb3VpUsXdenSRRMnTlRwcLA+//xz3X777WW1CQCuAIIMAI9Ur1493XvvvRo4cKBmzZqlG264QcePH9eaNWvUtGlT9ezZU7GxsTp+/LhmzJihO++8UytWrNDy5csVGBhY7LKXLVumH3/8UR07dlSVKlX02WefKS8vz7qiCYB9cPk1AI+VkJCggQMHaty4capfv7769u2rlJQU1axZU5LUsGFDvfjii5o3b56aNWumL7/8Uo8++uhFlxscHKwPP/xQnTt3VsOGDfXSSy9p8eLFaty4cXlvEoAy5jAXnmAGAACwCY7IAAAA2yLIAAAA2yLIAAAA2yLIAAAA2yLIAAAA2yLIAAAA2yLIAAAA2yLIAAAA2yLIAAAA2yLIAAAA2yLIAAAA2yLIAAAA2/p/v43HPpbBlfAAAAAASUVORK5CYII=", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import matplotlib.pyplot as plt\n", "\n", "\n", "model_names = [\"whisper-medium\", \"whisper-lora\",\"quantz-whisper-lora\"]\n", "wer_values = [13.639508070714834,13.624135280553421,14.044640098856966]\n", "wer_values = [round(value, 2) for value in wer_values]\n", "\n", "bar_colors = ['blue', 'green',\"red\"]\n", "# Create a bar chart\n", "plt.bar(model_names, wer_values,color=bar_colors)\n", "plt.xlabel(\"Fleurs\")\n", "plt.ylabel(\"WER (%)\")\n", "plt.title(\"Word Error Rate (WER) of Models\")\n", "plt.ylim(0, 15) # Set y-axis range to 0-100\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Vin100h" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## medium" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "DatasetDict({\n", " train: Dataset({\n", " features: ['input_features', 'input_length', 'attention_mask', 'labels'],\n", " num_rows: 44927\n", " })\n", " test: Dataset({\n", " features: ['input_features', 'input_length', 'attention_mask', 'labels'],\n", " num_rows: 11245\n", " })\n", "})\n" ] } ], "source": [ " # Load Dataset\n", "from datasets import load_dataset, DatasetDict, load_from_disk\n", "processed_dataset = DatasetDict()\n", "processed_dataset = load_from_disk(\"./vin_clean\")\n", "\n", "\n", "print(processed_dataset)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/tesla/miniconda3/envs/DUY/lib/python3.9/site-packages/transformers/models/auto/configuration_auto.py:992: FutureWarning: The `use_auth_token` argument is deprecated and will be removed in v5 of Transformers.\n", " warnings.warn(\n", "/home/tesla/miniconda3/envs/DUY/lib/python3.9/site-packages/transformers/models/auto/feature_extraction_auto.py:322: FutureWarning: The `use_auth_token` argument is deprecated and will be removed in v5 of Transformers.\n", " warnings.warn(\n", "/home/tesla/miniconda3/envs/DUY/lib/python3.9/site-packages/transformers/models/auto/tokenization_auto.py:628: FutureWarning: The `use_auth_token` argument is deprecated and will be removed in v5 of Transformers.\n", " warnings.warn(\n" ] } ], "source": [ "\n", "\n", "import datasets\n", "from datasets import DatasetDict, load_dataset, concatenate_datasets\n", "from tqdm import tqdm\n", "from transformers import (\n", " AutoConfig,\n", " AutoFeatureExtractor,\n", " AutoModelForSpeechSeq2Seq,\n", " AutoTokenizer,\n", " set_seed,\n", ")\n", "from tqdm import tqdm\n", "\n", "\n", "\n", "from datasets import Dataset, DatasetDict\n", "import torchaudio\n", "from torchaudio import transforms as at\n", "import pandas as pd\n", "import torch\n", "from pathlib import Path\n", "\n", "set_seed(42)\n", "\n", "\n", "config = AutoConfig.from_pretrained(\n", " \"openai/whisper-medium\", revision=\"main\", use_auth_token=True\n", " )\n", "\n", "config.update({\"forced_decoder_ids\": None, \"suppress_tokens\": None})\n", "\n", "\n", "\n", "feature_extractor = AutoFeatureExtractor.from_pretrained(\n", " \"openai/whisper-medium\",\n", " revision=\"main\",\n", " use_auth_token=True,\n", " )\n", "tokenizer = AutoTokenizer.from_pretrained(\n", " \"openai/whisper-medium\",\n", " use_fast=True,\n", " revision=\"main\",\n", " use_auth_token=True,\n", " )\n", "\n", "tokenizer.set_prefix_tokens(language=\"vi\", task=\"transcribe\")\n", "\n", "audio_column_name = \"audio\"\n", "text_column_name = \"transcription\"\n", "model_input_name = feature_extractor.model_input_names[0]\n", "\n", "\n", "forward_attention_mask = True\n", "\n", "\n", "\n", "def prepare_dataset(batch):\n", " # load and resample audio data from 48 to 16kHz\n", " audio = batch[\"audio\"]\n", "\n", " # compute log-Mel input features from input audio array \n", " batch[\"input_features\"] = feature_extractor(audio[\"array\"], sampling_rate=audio[\"sampling_rate\"]).input_features[0]\n", "\n", " # encode target text to label ids \n", " batch[\"labels\"] = tokenizer(batch[text_column_name]).input_ids\n", " return batch\n", "\n", "\n", "clean_data = processed_dataset['test']\n", "\n", "\n", "\n" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "import torch\n", "\n", "from dataclasses import dataclass\n", "from typing import Any, Dict, List, Union\n", "\n", "from transformers import WhisperProcessor\n", "\n", "processor = WhisperProcessor.from_pretrained(\"openai/whisper-medium\", language=\"vi\", task=\"transcribe\")\n", "@dataclass\n", "class DataCollatorSpeechSeq2SeqWithPadding:\n", " processor: Any\n", "\n", " def __call__(self, features: List[Dict[str, Union[List[int], torch.Tensor]]]) -> 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", "\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\n", "data_collator = DataCollatorSpeechSeq2SeqWithPadding(processor=processor)" ] }, { "cell_type": "code", "execution_count": 39, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "Dataset({\n", " features: ['input_features', 'input_length', 'attention_mask', 'labels'],\n", " num_rows: 11245\n", "})" ] }, "execution_count": 39, "metadata": {}, "output_type": "execute_result" } ], "source": [ "clean_data" ] }, { "cell_type": "code", "execution_count": 48, "metadata": {}, "outputs": [], "source": [ "torch.cuda.empty_cache()" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "from transformers import WhisperForConditionalGeneration\n", "\n", "\n", "model = WhisperForConditionalGeneration.from_pretrained(\n", " 'openai/whisper-medium', device_map=\"auto\"\n", ")" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "100%|██████████| 703/703 [1:42:04<00:00, 8.71s/it]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "wer=35.96574964967958 and normalized_wer=22.798881834138733\n", "{'eval/wer': 35.96574964967958, 'eval/normalized_wer': 22.798881834138733}\n" ] } ], "source": [ "import gc\n", "import numpy as np\n", "from tqdm import tqdm\n", "from torch.utils.data import DataLoader\n", "from transformers.models.whisper.english_normalizer import BasicTextNormalizer\n", "\n", "eval_dataloader = DataLoader(clean_data, batch_size=16, collate_fn=data_collator)\n", "forced_decoder_ids = processor.get_decoder_prompt_ids(language=\"vi\", task='transcribe')\n", "normalizer = BasicTextNormalizer()\n", "\n", "predictions = []\n", "references = []\n", "normalized_predictions = []\n", "normalized_references = []\n", "import evaluate\n", "metric = evaluate.load(\"wer\")\n", "model.eval()\n", "for step, batch in enumerate(tqdm(eval_dataloader)):\n", " with torch.cuda.amp.autocast():\n", " with torch.no_grad():\n", " generated_tokens = (\n", " model.generate(\n", " input_features=batch[\"input_features\"].to(\"cuda\"),\n", " forced_decoder_ids=forced_decoder_ids,\n", " max_new_tokens=255,\n", " )\n", " .cpu()\n", " .numpy()\n", " )\n", " labels = batch[\"labels\"].cpu().numpy()\n", " labels = np.where(labels != -100, labels, processor.tokenizer.pad_token_id)\n", " decoded_preds = processor.tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)\n", " decoded_labels = processor.tokenizer.batch_decode(labels, skip_special_tokens=True)\n", " predictions.extend(decoded_preds)\n", " references.extend(decoded_labels)\n", " normalized_predictions.extend([normalizer(pred).strip() for pred in decoded_preds])\n", " normalized_references.extend([normalizer(label).strip() for label in decoded_labels])\n", " del generated_tokens, labels, batch\n", " gc.collect()\n", "wer = 100 * metric.compute(predictions=predictions, references=references)\n", "normalized_wer = 100 * metric.compute(predictions=normalized_predictions, references=normalized_references)\n", "eval_metrics = {\"eval/wer\": wer, \"eval/normalized_wer\": normalized_wer}\n", "\n", "print(f\"{wer=} and {normalized_wer=}\")\n", "print(eval_metrics)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Lora" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "import torch\n", "from transformers import (\n", " AutomaticSpeechRecognitionPipeline,\n", " WhisperForConditionalGeneration,\n", " WhisperTokenizer,\n", " WhisperProcessor,\n", ")\n", "from peft import PeftModel, PeftConfig\n", "\n", "\n", "peft_model_id = \"DuyTa/vi-whisper-medium-Lora\"\n", "language = \"Vietnamese\"\n", "task = \"transcribe\"\n", "\n", "peft_config = PeftConfig.from_pretrained(peft_model_id)\n", "model = WhisperForConditionalGeneration.from_pretrained(\n", " peft_config.base_model_name_or_path\n", ")\n", "model = PeftModel.from_pretrained(model, peft_model_id)\n", "model.to(\"cuda:0\").half()\n", "\n", "processor = WhisperProcessor.from_pretrained(peft_config.base_model_name_or_path, language=language, task=task)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "data_collator = DataCollatorSpeechSeq2SeqWithPadding(processor=processor)" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "100%|██████████| 703/703 [2:13:50<00:00, 11.42s/it] \n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "wer=35.96574964967958 and normalized_wer=22.798881834138733\n", "{'eval/wer': 35.95314171676819, 'eval/normalized_wer': 22.793825528564515}\n" ] } ], "source": [ "import gc\n", "import numpy as np\n", "from tqdm import tqdm\n", "from torch.utils.data import DataLoader\n", "from transformers.models.whisper.english_normalizer import BasicTextNormalizer\n", "\n", "eval_dataloader = DataLoader(clean_data, batch_size=16, collate_fn=data_collator)\n", "forced_decoder_ids = processor.get_decoder_prompt_ids(language=language, task='transcribe')\n", "normalizer = BasicTextNormalizer()\n", "\n", "predictions = []\n", "references = []\n", "normalized_predictions = []\n", "normalized_references = []\n", "import evaluate\n", "metric = evaluate.load(\"wer\")\n", "model.eval()\n", "for step, batch in enumerate(tqdm(eval_dataloader)):\n", " with torch.cuda.amp.autocast():\n", " with torch.no_grad():\n", " generated_tokens = (\n", " model.generate(\n", " input_features=batch[\"input_features\"].to(\"cuda\"),\n", " forced_decoder_ids=forced_decoder_ids,\n", " max_new_tokens=255,\n", " )\n", " .cpu()\n", " .numpy()\n", " )\n", " labels = batch[\"labels\"].cpu().numpy()\n", " labels = np.where(labels != -100, labels, processor.tokenizer.pad_token_id)\n", " decoded_preds = processor.tokenizer.batch_decode(generated_tokens, skip_special_tokens=True)\n", " decoded_labels = processor.tokenizer.batch_decode(labels, skip_special_tokens=True)\n", " predictions.extend(decoded_preds)\n", " references.extend(decoded_labels)\n", " normalized_predictions.extend([normalizer(pred).strip() for pred in decoded_preds])\n", " normalized_references.extend([normalizer(label).strip() for label in decoded_labels])\n", " del generated_tokens, labels, batch\n", " gc.collect()\n", "lora_wer = 100 * metric.compute(predictions=predictions, references=references)\n", "lora_normalized_wer = 100 * metric.compute(predictions=normalized_predictions, references=normalized_references)\n", "eval_metrics = {\"eval/wer\": lora_wer, \"eval/normalized_wer\": lora_normalized_wer}\n", "\n", "print(f\"{wer=} and {normalized_wer=}\")\n", "print(eval_metrics)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Quantized model" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [], "source": [ "from whisper_quant import WhisperModel\n", "\n", "model_size = \"medium\"\n", "\n", "# Run on GPU with FP16\n", "model = WhisperModel(model_size, device=\"cuda\", compute_type=\"float16\")" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### format dataset for quantized model" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "import logging\n", "import numpy as np\n", "import datasets\n", "from datasets import DatasetDict, load_dataset, concatenate_datasets\n", "from tqdm import tqdm\n", "from transformers import (\n", " AutoConfig,\n", " AutoFeatureExtractor,\n", " AutoModelForSpeechSeq2Seq,\n", " AutoTokenizer,\n", " set_seed,\n", ")\n", "from transformers.utils.versions import require_version\n", "from transformers.utils import check_min_version\n", "from tqdm import tqdm\n", "\n", "\n", "\n", "\n", "logger = logging.getLogger(__name__)\n", "from datasets import Dataset, DatasetDict\n", "import torchaudio\n", "from torchaudio import transforms as at\n", "import pandas as pd\n", "import torch\n", "from pathlib import Path\n", "\n", "def main():\n", " set_seed(42)\n", "\n", "\n", " max_input_length = 30.0 * 16000\n", " min_input_length = 0.0 * 16000\n", " audio_column_name = \"audio\"\n", " text_column_name = \"text\"\n", "\n", "\n", "\n", "\n", "\n", " def load_wave(wave_path, sample_rate:int=16000) -> np.ndarray:\n", " waveform, sr = torchaudio.load(wave_path, normalize=True)\n", " if sample_rate != sr:\n", " waveform = at.Resample(sr, sample_rate)(waveform)\n", " return np.asarray(waveform)\n", " \n", "\n", " def get_list_files_vin100h(phase, sample_rate=16000, audio_max_sample_length=480000):\n", " audio_list = []\n", " text_list = []\n", " path_list = []\n", " if phase == 'train':\n", " csv_file = 'vin_train.csv'\n", " else:\n", " csv_file = 'vin_test.csv'\n", " df = pd.read_csv(csv_file)\n", " for index, row in tqdm(df.iterrows()):\n", " path = row['path']\n", " new_path = Path(row['path'])\n", " audio_id = index\n", " text = row['sentence']\n", " if new_path.exists():\n", " audio = load_wave(new_path, sample_rate=sample_rate)[0]\n", " if len(audio) > audio_max_sample_length or len(audio) < 0:\n", " print('skip file:', new_path,'with len audio', len(audio))\n", " del new_path\n", " continue\n", " text_list.append(text)\n", " path_list.append(path) \n", "\n", " return path_list, text_list\n", "\n", "\n", "\n", "\n", " # Get the testing dataset\n", " test_audio, test_text = get_list_files_vin100h(phase='test')\n", " #print(test_audio[0])\n", " test_dataset = Dataset.from_dict({\"audio\": test_audio, \"text\": test_text})\n", " vin_100h = DatasetDict({\"test\": test_dataset})\n", " #print(clean_data)\n", "\n", "\n", " return vin_100h, test_dataset\n", "\n", "\n", "if __name__ == \"__main__\":\n", " clean_data, test_dataset = main()" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "DatasetDict({\n", " test: Dataset({\n", " features: ['audio', 'text'],\n", " num_rows: 11245\n", " })\n", "})" ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "clean_data" ] }, { "cell_type": "code", "execution_count": 21, "metadata": {}, "outputs": [], "source": [ "\n", "segments, _ = model.transcribe(clean_data['test']['audio'][0], beam_size=1, language='vi', temperature= 0)\n" ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ " Cây cam canh là loại cây ăn quả dễ chồng, dễ chăm sót và cho năng suốt cao nên hiện nay được chồng ở nhiều địa phương trong nước ta.\n", " Cam canh có đặc điểm phỏ mỏng, ăn rất ngọt.\n" ] } ], "source": [ "for segment in segments :\n", " print(segment.text)" ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [], "source": [ "import torch\n", "from dataclasses import dataclass\n", "\n", "@dataclass\n", "class DataCollatorSpeechSeq2SeqWithPadding:\n", "\n", " def __call__(self, features):\n", " batch = {\n", " \"audio\": [feature[\"audio\"] for feature in features],\n", " \"transcription\": [feature[\"text\"] for feature in features]\n", " }\n", " return batch\n", "data_collator = DataCollatorSpeechSeq2SeqWithPadding()" ] }, { "cell_type": "code", "execution_count": 26, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "100%|██████████| 703/703 [1:48:04<00:00, 9.22s/it]\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "wer_quantz=21.69356959398854\n" ] } ], "source": [ "from torch.utils.data import DataLoader\n", "import re\n", "from tqdm import tqdm\n", "import numpy as np\n", "import gc\n", "import evaluate\n", "metric = evaluate.load(\"wer\")\n", "from transformers.models.whisper.english_normalizer import BasicTextNormalizer\n", "normalizer = BasicTextNormalizer()\n", "eval_dataloader = DataLoader(clean_data['test'], batch_size=16, collate_fn=data_collator)\n", "for step, batch in enumerate(tqdm(eval_dataloader)):\n", " with torch.cuda.amp.autocast():\n", " with torch.no_grad():\n", " final = []\n", " labels = batch[\"transcription\"]\n", " for audio in batch[\"audio\"]:\n", " \n", " segments, _ = model.transcribe(audio, beam_size=1, language='vi',temperature=0)\n", " out = [out.text for out in segments]\n", " pred = ''.join(out)\n", " norm_pred = normalizer(pred)\n", " final.append(norm_pred)\n", " cleaned_text_list = [re.sub(r'\\s+', ' ', text.strip()) for text in final]\n", " #print(cleaned_text_list)\n", " #print(labels)\n", " metric.add_batch(\n", " predictions=cleaned_text_list,\n", " references=labels,\n", " )\n", " del labels, batch, final\n", " gc.collect()\n", "wer_quantz = 100 * metric.compute()\n", "print(f\"{wer_quantz=}\")\n", "\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 35, "metadata": {}, "outputs": [], "source": [ "normalized_wer=22.798881834138733\n", "lora_wer = 22.793825528564515" ] }, { "cell_type": "code", "execution_count": 38, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAjIAAAHHCAYAAACle7JuAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8pXeV/AAAACXBIWXMAAA9hAAAPYQGoP6dpAABD80lEQVR4nO3dfVwU5f7/8fcKuoDcKMhtIahpSCnmzTHUBG9OeJuWadqNaKZ21MqbOud4Mm/ynEit1HMyq1NBedLKSi1Ly0xI8Sa17E6zNE2tRPMGEBUMrt8f/divKzeCgruTr+fjsQ+dmWtnP7M7O7x3Zq4ZmzHGCAAAwIJquLoAAACAC0WQAQAAlkWQAQAAlkWQAQAAlkWQAQAAlkWQAQAAlkWQAQAAlkWQAQAAlkWQAQAAlkWQAS5Qenq6bDab0tPTXV0K/r833nhDgYGBOnHihKtLOa9nn31W9evXV35+fpXPe+XKlWrRooW8vLxks9l0/PjxKn+Ni2Wz2TR16tRKP2/v3r2y2WxKS0ur8ppgTQQZuLU33nhDNptNS5YsKTEtLi5ONptNa9asKTGtfv36ateu3aUo8bzS0tJks9nKfGzcuNHVJZZqyJAhTnXa7XY1adJEkydP1unTpy9ontu3b9fUqVO1d+/eqi1WUmFhoaZMmaL77rtPvr6+kqTY2FjFxcWVaLtkyRLZbDYlJCSUmPbSSy/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UI33HCDateuLT8/P/Xs2VPffPPNees6ffq0Vq5cWWIPRPF7lJmZ6dT2s88+0y233KKGDRs6TTt8+LC+++67iw7BZ2vatKnq1aun3bt3l5jWqlUrBQYGatmyZRWa1+LFi9WqVSt5e3urXr16uvPOO/XTTz85picmJio5OVmS1KZNG9lsNg0ZMuS88x00aJCOHDmiVatWOcYVFBTozTff1O23317qc/Ly8jRhwgRFRkbKbrfr6quv1hNPPCFjjFO7/Px8jRs3TsHBwfLz89NNN92kAwcOlDrPn376SXfffbdCQ0Nlt9t1zTXX6KWXXjpv/QcPHtTQoUN15ZVXym63Kzw8XH369KmWQ5hwP+yRgdvr0KGDFixYoE2bNikxMVHS73+Y2rVrp3bt2ik7O1tff/21mjdv7pgWExOjoKAgSdI999yjl19+WbfeeqsmTJigTZs2KSUlRTt27Chx7s3OnTs1aNAgjRw5UsOHD9fVV1+tU6dOqUuXLtq3b5/uv/9+RUREaMGCBfr4448rtRzZ2dklftnabDZHncVSU1N1+vRpjRgxQna7XYGBgY5p/fv3V+PGjfXYY485/mBc7PJVVvEfh7p16zrGbd68WevXr9fAgQN15ZVXau/evZo/f74SExO1fft2+fj4qGPHjrr//vv173//W//4xz/UtGlTSXL8u2DBAiUnJyspKUkzZszQyZMnNX/+fEeQLe9Q1NatW1VQUKCWLVs6jW/YsKEiIiKc9tpt3rxZBQUFjvUnMzNTEyZMkCStX79eUul78yr6+ZX2vGPHjqlRo0alTm/ZsqVTmCpLWlqahg4dqjZt2iglJUVZWVmaO3euMjMz9fnnn6tOnTp6+OGHdfXVV+v55593HAor63XPFh0drfj4eC1atMix52rFihXKzs7WwIED9e9//9upvTFGN910k9asWaNhw4apRYsW+uCDD/TQQw/pp59+0uzZsx1t77nnHv3vf//T7bffrnbt2unjjz9Wz549S9SQlZWl66+/XjabTWPGjFFwcLBWrFihYcOGKScnR2PHji2z/n79+umbb77Rfffdp+joaB06dEirVq3Svn37qvwQJtyQAdzcN998YySZ6dOnG2OMOXPmjKldu7Z5+e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0Jdffqm//e1v+tOf/qS333671PlMnTpV06ZNu1RlAwCAarR///4SN4M9m9sEmb/85S9asWKF1q1bV27BH3/8sbp06aJdu3aVuDW8VHKPTHZ2turXr6/9+/fL39+/WmoHAABVKycnR5GRkTp+/LgCAgLKbOcWh5bGjBmj5cuX65NPPik3xEhS27ZtJanMIGO322W320uM9/f3J8gAAGAx5zstxKVBxhij++67T0uWLFF6eroaNGhw3uds27ZNkhQeHl7N1QEAAHfn0iAzevRoLVy4UMuWLZOfn58OHjwoSQoICJC3t7d2796thQsXqkePHgoKCtKXX36pcePGqWPHjmrevLkrSwcAAG7ApefIlLW7KDU1VUOGDNH+/ft155136uuvv1ZeXp4iIyN18803a9KkSRU+TJSTk6OAgABlZ2dzaAkAAIuo6N9vlx9aKk9kZKQyMjIuUTUAAMBquNcSAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLE9XF2BlNpurK4CrGePa17dNYyW83JkpLl4JARdjjwwAALAsggwAALAsggwAALAsggwAALAsggwAALAsggwAALAsggwAALAsggwAALAsggwAALAsggwAALAsggwAALAsggwAALAsggwAALAsggwAALAsggwAALAsT1cXAACwOJvN1RXAlYxx6cuzRwYAAFgWQQYAAFgWQQYAAFgWQQYAAFgWQQYAAFgWQQYAAFgWQQYAAFgWQQYAAFgWQQYAAFgWQQYAAFgWQQYAAFgWQQYAAFgWQQYAAFgWQQYAAFgWQQYAAFgWQQYAAFgWQQYAAFgWQQYAAFgWQQYAAFgWQQYAAFiWS4NMSkqK2rRpIz8/P4WEhKhv377auXOnU5vTp09r9OjRCgoKkq+vr/r166esrCwXVQwAANyJS4NMRkaGRo8erY0bN2rVqlU6c+aMbrzxRuXl5TnajBs3Tu+++64WL16s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WSgWZVq1aadmyZY5hT09PHTp0yDGclZWlWrVqVV11AAAA5ajUoaUPPvhAo0ePVlpamubNm6e5c+fqtttuU2FhoX777TfVqFFDaWlp1VQqAACAs0oFmejoaL333ntatGiREhISdP/992vXrl3atWuXCgsLFRMTIy8vr+qqFQAAwMkFXX530KBB2rx5s7744gslJiaqqKhILVq0IMQAAIBLqtK9lt5//33t2LFDcXFxeuGFF5SRkaE77rhD3bt316OPPipvb+/qqBMAAKCESu2RmTBhgoYOHarNmzdr5MiRmj59uhISEvTZZ5/Jy8tL1113nVasWFFdtQIAADixmbPv/HgeQUFB+vDDD9WqVSsdPXpU119/vb777jvH9O3bt2vkyJFau3ZttRR7IXJychQQEKDs7Gz5+/tX6bxttiqdHSyo4t+e6mGbxkp4uTNTXLwSSmwML3fVtCGs6N/vSu2RqV27tvbs2SNJ2r9/f4lzYmJjY90qxAAAgD+2SgWZlJQUDR48WBEREUpISND06dOrqy4AAIDzqtTJvnfccYe6deumH374QY0bN1adOnWqqSwAAIDzq3SvpaCgIAUFBVVHLQAAAJVS4UNL9957rw4cOFChtq+//rpeffXVCy4KAACgIiq8RyY4OFjXXHON2rdvr969e6t169aKiIiQl5eXjh07pu3bt2vdunV67bXXFBERoeeff7466wYAAKhc9+usrCy98MILeu2117R9+3anaX5+furatavuuecedevWrcoLvVB0v0Z1ovs1XI3u13A5F3e/rlSQOduxY8e0b98+nTp1SvXq1VOjRo1kc8OVmSCD6kSQgasRZOByLg4ylT7Zt1jdunVVt27dC306AADARbugm0YCAAC4A4IMAACwLIIMAACwLIIMAACwrCoNMqdPn9YTTzxRlbMEAAAoU6WDzOHDh7V8+XJ9+OGHKiwslCSdOXNGc+fOVXR0tB5//PEqLxIAAKA0lep+vW7dOvXq1Us5OTmy2Wxq3bq1UlNT1bdvX3l6emrq1KlKTk6urloBAACcVGqPzKRJk9SjRw99+eWXGj9+vDZv3qybb75Zjz32mLZv3657771X3t7e1VUrAACAk0pd2TcoKEhr165VbGysTp06JV9fX7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JkddUBAABQaRd1si8AAIAruTTIfPLJJ+rdu7ciIiJks9m0dOlSp+nGGE2ePFnh4eHy9vZW165d9f3337umWAAA4HZcGmTy8vIUFxenefPmlTp95syZ+ve//61nn31WmzZtUu3atZWUlKTTp09f4koBAIA7uuC7X1eF7t27q3v37qVOM8Zozpw5mjRpkvr06SNJeuWVVxQaGqqlS5dq4MCBl7JUAADghtz2HJk9e/bo4MGD6tq1q2NcQECA2rZtqw0bNpT5vPz8fOXk5Dg9AADAH5PbBpmDBw9KkkJDQ53Gh4aGOqaVJiUlRQEBAY5HZGRktdYJAABcx22DzIWaOHGisrOzHY/9+/e7uiQAAFBN3DbIhIWFSZKysrKcxmdlZTmmlcZut8vf39/pAQAA/pjcNsg0aNBAYWFhWr16tWNcTk6ONm3apPj4eBdWBgAA3IVLey2dOHFCu3btcgzv2bNH27ZtU2BgoOrXr6+xY8fqn//8pxo3bqwGDRrokUceUUREhPr27eu6ogEAgNtwaZDZsmWL092yx48fL0lKTk5WWlqa/vrXvyovL08jRozQ8ePH1aFDB61cuVJeXl6uKhkAALgRmzHGuLqI6pSTk6OAgABlZ2dX+fkyNluVzg4W5Opvj20aK+Hlzkxxg004G8PLWzVtCCv699ttz5EBAAA4H4IMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLIIMAACwLLcOMlOnTpXNZnN6xMTEuLosAADgJjxdXcD5XHPNNfroo48cw56ebl8yAAC4RNw+FXh6eiosLMzVZQAAADfk1oeWJOn7779XRESEGjZsqDvuuEP79u0rt31+fr5ycnKcHgAA4I/JrYNM27ZtlZaWppUrV2r+/Pnas2ePbrjhBuXm5pb5nJSUFAUEBDgekZGRl7BiAABwKdmMMcbVRVTU8ePHFRUVpaeeekrDhg0rtU1+fr7y8/Mdwzk5OYqMjFR2drb8/f2rtB6brUpnBwty9bfHNo2V8HJnprjBJpyN4eWtmjaEOTk5CggIOO/fb7c/R+ZsderUUZMmTbRr164y29jtdtnt9ktYFQAAcBW3PrR0rhMnTmj37t0KDw93dSkAAMANuHWQefDBB5WRkaG9e/dq/fr1uvnmm+Xh4aFBgwa5ujQAAOAG3PrQ0oEDBzRo0CAdOXJEwcHB6tChgzZu3Kjg4GBXlwYAANyAWweZ1157zdUlAAAAN+bWh5YAAADKQ5ABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWRZABAACWZYkgM2/ePEVHR8vLy0tt27bVp59+6uqSAACAG3D7IPP6669r/PjxmjJlij777DPFxcUpKSlJhw4dcnVpAADAxdw+yDz11FMaPny4hg4dqtjYWD377LPy8fHRSy+95OrSAACAi7l1kCkoKNDWrVvV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nyFSz4vMMZs+e7djoJyYm6vHHH9exY8dKfDkqw2azqX379mrfvr0mT56sqKgoLVmyROPHj5f0e4o/deqUvL29JUkbN26Ur6+vIiMjFRgY6Dhp69xfGuW56qqrLrjes7Vs2VIHDx6Up6enoqOjS23TtGlTbdq0SYMHD3aM27hxY7nzDQ4OdjrBNCcnR3v27KmSmi9Hl9v66+/vr4iICGVmZjrNNzMzU3/605/KfW5mZqb69OnjOPm5qKhI3333nWJjYytcn1U0atRINWvW1KZNm1S/fn1Jv580+t133znet3O/i99//71OnjzpGF6/fr2ioqL08MMPO8b9+OOPla6lVq1ajnNbip0+fVp9+vRRTEyMnnrqKadpgYGBCgwMLDGfhIQEvfTSS/L09FS3bt0k/b6uL1q0SN99953T+TEXwtvbW71791bv3r01evRoxcTE6KuvvlLLli0lldy2bdy4UU2bNpVUse1laa93vvW9adOm+u2337Rp0ya1a9dOknTkyBHt3LnzvOttZmamnnnmGfXo0UOStH//fv36668Vqq2qEWSqWd26ddW8eXO9+uqrevrppyVJHTt21IABA3TmzJlKbYTPtmnTJq1evVo33nijQkJCtGnTJh0+fNix4ku/d78bNmyYJk2apL1792rKlCkaM2aMatSoIT8/Pz344IMaN26cioqK1KFDB2VnZyszM1P+/v5KTk6ukuUvS9euXRUfH6++fftq5syZatKkiX7++We99957uvnmm9W6dWs98MADGjJkiFq3bq327dvr1Vdf1TfffKOGDRuWOd/OnTsrLS1NvXv3Vp06dTR58mSn3b+onMtx/X3ooYc0ZcoUNWrUSC1atFBqaqq2bdtW6q75szVu3Fhvvvmm1q9fr7p16+qpp55SVlbWHzLI+Pr6atiwYXrooYcUFBSkkJAQPfzww06Hkjt37qynn35a8fHxKiws1N/+9jenvQ+NGzfWvn379Nprr6lNmzZ67733tGTJkkrXEh0drU2bNmnv3r3y9fVVYGCgRo4cqf3792v16tU6fPiwo21gYGCZXZI7duyo3NxcLV++3HEycWJiom699VaFh4erSZMmla6tWFpamgoLC9W2bVv5+Pjof//7n7y9vRUVFeVok5mZqZkzZ6pv375atWqVFi9erPfee09SxbaXF6Jx48bq06ePhg8frueee05+fn76+9//riuuuEJ9+vQ573MXLFig1q1bKycnRw899JDjR8elRpC5BBISErRt2zZHog8MDFRsbKyysrIqfUy5mL+/vz755BPNmTNHOTk5ioqK0pNPPqnu3bs72nTp0kWNGzdWx44dlZ+fr0GDBjl1Q54+fbqCg4OVkpKiH374QXXq1FHLli31j3/842IWt0JsNpvef/99Pfzwwxo6dKgOHz6ssLAwdezY0bEL9LbbbtPu3bv117/+VadPn1a/fv30l7/8RR988EGZ8504caL27NmjXr16KSAgQNOnT2ePzEW63Nbf+++/X9nZ2ZowYYIOHTqk2NhYvfPOO45zgcoyadIk/fDDD0pKSpKPj49GjBihvn37Kjs7+6LqcVezZs3SiRMn1Lt3b/n5+WnChAlOy/rkk09q6NChuuGGGxQREaG5c+dq69atjuk33XSTxo0bpzFjxig/P189e/bUI4884vQZV8SDDz6o5ORkxcbG6tSpU9qzZ48yMjL0yy+/lAiRa9asKXPPSt26ddWsWTNlZWU5ejd17NhRRUVFFxzYi9WpU0ePP/64xo8fr8LCQjVr1kzvvvuugoKCHG0mTJigLVu2aNq0afL399dTTz2lpKQkSRXbXl6o1NRUPfDAA+rVq5cKCgrUsWNHvf/+++c95PXiiy9qxIgRatmypSIjI/XYY4+V2UuxutlMWQexYWlDhgzR8ePHS1zHAbAC1l9rcter7Lq76OhojR079g9364BLhV5LAADAsggyAADAsji0BAAALIs9MgAAwLIIMgAAwLIIMgAAwLIIMgAAwLIIMgAuualTp6pFixauLqNU7lwbgJIIMgCqVO/evR33qjnX2rVrZbPZdMstt2j16tWVmu/bb7+tG2+8UUFBQbLZbE43xCt2+vRpjR492nGX4H79+ikrK8upzb59+9SzZ0/5+PgoJCREDz30UIk7EQOwDoIMgCo1bNgwrVq1SgcOHCgxLTU1Va1bt1bz5s2dLs9eEXl5eerQoYNmzJhRZptx48bp3Xff1eLFi5WRkaGff/5Zt9xyi2N6YWGhevbsqYKCAq1fv14vv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Ro8eLAeffTRi6oNgOvYzNn9IwEAACyEPTIAAMCyCDIAAMCyCDIAAMCyCDIAAMCyCDIAAMCyCDIAAMCyCDIAAMCyCDIAAMCyCDIAAMCyCDIAAMCyCDIAAMCyCDIAAMCy/h+KIXuW8TPLtQAAAABJRU5ErkJggg==", "text/plain": [ "
" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import matplotlib.pyplot as plt\n", "\n", "\n", "model_names = [\"whisper-medium\", \"whisper-lora\",\"quantz-whisper-lora\"]\n", "wer_values = [normalized_wer,lora_wer,wer_quantz]\n", "\n", "\n", "bar_colors = ['blue', 'green',\"red\"]\n", "# Create a bar chart\n", "plt.bar(model_names, wer_values,color=bar_colors)\n", "plt.xlabel(\"Vin100h\")\n", "plt.ylabel(\"WER (%)\")\n", "plt.title(\"Word Error Rate (WER) of Models\")\n", "plt.ylim(0, 25) # Set y-axis range to 0-100\n", "plt.show()" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "The model 'PeftModel' is not supported for . Supported models are ['SpeechEncoderDecoderModel', 'Speech2TextForConditionalGeneration', 'SpeechT5ForSpeechToText', 'WhisperForConditionalGeneration', 'Data2VecAudioForCTC', 'HubertForCTC', 'MCTCTForCTC', 'SEWForCTC', 'SEWDForCTC', 'UniSpeechForCTC', 'UniSpeechSatForCTC', 'Wav2Vec2ForCTC', 'Wav2Vec2ConformerForCTC', 'WavLMForCTC'].\n" ] } ], "source": [ "import torch\n", "from transformers import (\n", " AutomaticSpeechRecognitionPipeline,\n", " WhisperForConditionalGeneration,\n", " WhisperTokenizer,\n", " WhisperProcessor,\n", ")\n", "from peft import PeftModel, PeftConfig\n", "\n", "\n", "peft_model_id = \"DuyTa/vi-whisper-medium-Lora\"\n", "language = \"Vietnamese\"\n", "task = \"transcribe\"\n", "\n", "peft_config = PeftConfig.from_pretrained(peft_model_id)\n", "model = WhisperForConditionalGeneration.from_pretrained(\n", " peft_config.base_model_name_or_path\n", ")\n", "peft_model = PeftModel.from_pretrained(model, peft_model_id)\n", "peft_model.to(\"cuda:0\").half()\n", "\n", "processor = WhisperProcessor.from_pretrained(peft_config.base_model_name_or_path, language=language, task=task)\n", "\n", "pipe = AutomaticSpeechRecognitionPipeline(model=peft_model, tokenizer=processor.tokenizer, feature_extractor=processor.feature_extractor, batch_size=8, torch_dtype=torch.float16, device=\"cuda:0\")\n", "\n", "def transcribe(audio, return_timestamps=False):\n", " text = pipe(audio, chunk_length_s=30, return_timestamps=return_timestamps, generate_kwargs={\"language\": language, \"task\": task},)[\"text\"]\n", " return text" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import torch\n", "from transformers import pipeline\n", "from datasets import load_dataset\n", "\n", "device = \"cuda:0\" if torch.cuda.is_available() else \"cpu\"\n", "\n", "pipe = pipeline(\n", " \"automatic-speech-recognition\",\n", " model=\"openai/whisper-medium\",\n", " chunk_length_s=30,\n", " device=device,\n", ")\n", "\n", "def transcribe_hf(audio, return_timestamps=False):\n", " text = pipe(audio, chunk_length_s=30, return_timestamps=return_timestamps, generate_kwargs={\"language\": language, \"task\": task},max_new_tokens =448)[\"text\"]\n", " return text\n" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "def transcribe(audio, return_timestamps=False):\n", " text = pipe(audio, chunk_length_s=30, return_timestamps=return_timestamps, generate_kwargs={\"language\": language, \"task\": task}, max_new_tokens =448)[\"text\"]\n", " return text" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "faster-whisper: 0.643276 seconds\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/home/tesla/miniconda3/envs/DUY/lib/python3.9/site-packages/transformers/pipelines/base.py:1090: UserWarning: You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset\n", " warnings.warn(\n", "ffmpeg: /home/tesla/miniconda3/lib/libncursesw.so.6: no version information available (required by /lib/x86_64-linux-gnu/libcaca.so.0)\n", "ffmpeg: /home/tesla/miniconda3/lib/libncursesw.so.6: no version information available (required by /lib/x86_64-linux-gnu/libcaca.so.0)\n", "ffmpeg: /home/tesla/miniconda3/lib/libtinfo.so.6: no version information available (required by /lib/x86_64-linux-gnu/libcaca.so.0)\n", "/home/tesla/miniconda3/envs/DUY/lib/python3.9/site-packages/transformers/pipelines/base.py:1090: UserWarning: You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset\n", " warnings.warn(\n", "ffmpeg: /home/tesla/miniconda3/lib/libncursesw.so.6: no version information available (required by /lib/x86_64-linux-gnu/libcaca.so.0)\n", "ffmpeg: /home/tesla/miniconda3/lib/libncursesw.so.6: no version information available (required by /lib/x86_64-linux-gnu/libcaca.so.0)\n", "ffmpeg: /home/tesla/miniconda3/lib/libtinfo.so.6: no version information available (required by /lib/x86_64-linux-gnu/libcaca.so.0)\n", "/home/tesla/miniconda3/envs/DUY/lib/python3.9/site-packages/transformers/pipelines/base.py:1090: UserWarning: You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset\n", " warnings.warn(\n", "ffmpeg: /home/tesla/miniconda3/lib/libncursesw.so.6: no version information available (required by /lib/x86_64-linux-gnu/libcaca.so.0)\n", "ffmpeg: /home/tesla/miniconda3/lib/libncursesw.so.6: no version information available (required by /lib/x86_64-linux-gnu/libcaca.so.0)\n", "ffmpeg: /home/tesla/miniconda3/lib/libtinfo.so.6: no version information available (required by /lib/x86_64-linux-gnu/libcaca.so.0)\n", "/home/tesla/miniconda3/envs/DUY/lib/python3.9/site-packages/transformers/pipelines/base.py:1090: UserWarning: You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset\n", " warnings.warn(\n", "ffmpeg: /home/tesla/miniconda3/lib/libncursesw.so.6: no version information available (required by /lib/x86_64-linux-gnu/libcaca.so.0)\n", "ffmpeg: /home/tesla/miniconda3/lib/libncursesw.so.6: no version information available (required by /lib/x86_64-linux-gnu/libcaca.so.0)\n", "ffmpeg: /home/tesla/miniconda3/lib/libtinfo.so.6: no version information available (required by /lib/x86_64-linux-gnu/libcaca.so.0)\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "lora-whisper: 2.030503 seconds\n" ] }, { "name": "stderr", "output_type": "stream", "text": [ "/home/tesla/miniconda3/envs/DUY/lib/python3.9/site-packages/transformers/pipelines/base.py:1090: UserWarning: You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset\n", " warnings.warn(\n", "ffmpeg: /home/tesla/miniconda3/lib/libncursesw.so.6: no version information available (required by /lib/x86_64-linux-gnu/libcaca.so.0)\n", "ffmpeg: /home/tesla/miniconda3/lib/libncursesw.so.6: no version information available (required by /lib/x86_64-linux-gnu/libcaca.so.0)\n", "ffmpeg: /home/tesla/miniconda3/lib/libtinfo.so.6: no version information available (required by /lib/x86_64-linux-gnu/libcaca.so.0)\n", "/home/tesla/miniconda3/envs/DUY/lib/python3.9/site-packages/transformers/generation/utils.py:1396: UserWarning: Using the model-agnostic default `max_length` (=448) to control the generation length. recommend setting `max_new_tokens` to control the maximum length of the generation.\n", " warnings.warn(\n", "/home/tesla/miniconda3/envs/DUY/lib/python3.9/site-packages/transformers/pipelines/base.py:1090: UserWarning: You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset\n", " warnings.warn(\n", "ffmpeg: /home/tesla/miniconda3/lib/libncursesw.so.6: no version information available (required by /lib/x86_64-linux-gnu/libcaca.so.0)\n", "ffmpeg: /home/tesla/miniconda3/lib/libncursesw.so.6: no version information available (required by /lib/x86_64-linux-gnu/libcaca.so.0)\n", "ffmpeg: /home/tesla/miniconda3/lib/libtinfo.so.6: no version information available (required by /lib/x86_64-linux-gnu/libcaca.so.0)\n", "/home/tesla/miniconda3/envs/DUY/lib/python3.9/site-packages/transformers/generation/utils.py:1396: UserWarning: Using the model-agnostic default `max_length` (=448) to control the generation length. recommend setting `max_new_tokens` to control the maximum length of the generation.\n", " warnings.warn(\n", "/home/tesla/miniconda3/envs/DUY/lib/python3.9/site-packages/transformers/pipelines/base.py:1090: UserWarning: You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset\n", " warnings.warn(\n", "ffmpeg: /home/tesla/miniconda3/lib/libncursesw.so.6: no version information available (required by /lib/x86_64-linux-gnu/libcaca.so.0)\n", "ffmpeg: /home/tesla/miniconda3/lib/libncursesw.so.6: no version information available (required by /lib/x86_64-linux-gnu/libcaca.so.0)\n", "ffmpeg: /home/tesla/miniconda3/lib/libtinfo.so.6: no version information available (required by /lib/x86_64-linux-gnu/libcaca.so.0)\n", "/home/tesla/miniconda3/envs/DUY/lib/python3.9/site-packages/transformers/generation/utils.py:1396: UserWarning: Using the model-agnostic default `max_length` (=448) to control the generation length. recommend setting `max_new_tokens` to control the maximum length of the generation.\n", " warnings.warn(\n", "/home/tesla/miniconda3/envs/DUY/lib/python3.9/site-packages/transformers/pipelines/base.py:1090: UserWarning: You seem to be using the pipelines sequentially on GPU. In order to maximize efficiency please use a dataset\n", " warnings.warn(\n", "ffmpeg: /home/tesla/miniconda3/lib/libncursesw.so.6: no version information available (required by /lib/x86_64-linux-gnu/libcaca.so.0)\n", "ffmpeg: /home/tesla/miniconda3/lib/libncursesw.so.6: no version information available (required by /lib/x86_64-linux-gnu/libcaca.so.0)\n", "ffmpeg: /home/tesla/miniconda3/lib/libtinfo.so.6: no version information available (required by /lib/x86_64-linux-gnu/libcaca.so.0)\n", "/home/tesla/miniconda3/envs/DUY/lib/python3.9/site-packages/transformers/generation/utils.py:1396: UserWarning: Using the model-agnostic default `max_length` (=448) to control the generation length. recommend setting `max_new_tokens` to control the maximum length of the generation.\n", " warnings.warn(\n" ] }, { "name": "stdout", "output_type": "stream", "text": [ "hf-whisper: 1.959464 seconds\n" ] } ], "source": [ "import os\n", "import time\n", "\n", "\n", "import whisper\n", "from whisper_quant import WhisperModel\n", "\n", "#SSopenai_whisper_model = whisper.load_model(\"medium\", device=\"cuda\")\n", "faster_whisper_model = WhisperModel(\"medium\", device=\"cuda\", compute_type = \"float16\")\n", "\n", "input_file = \"audio.wav\"\n", "samples = 3\n", "\n", "\n", "# def run_openai_whisper():\n", "# result = openai_whisper_model.transcribe(input_file, beam_size=1)\n", "\n", "\n", "def run_lora_whisper():\n", " text = transcribe(input_file)\n", "\n", "def run_hf_whisper():\n", " text = transcribe_hf(input_file)\n", "\n", "def run_faster_whisper():\n", " segments, _ = faster_whisper_model.transcribe(input_file, beam_size=1, best_of=1)\n", " segments = list(segments)\n", "\n", "\n", "def measure_execution_time(name, func, samples=3):\n", " func()\n", "\n", " start = time.time()\n", " for _ in range(samples):\n", " func()\n", " end = time.time()\n", "\n", " print(\"%s: %f seconds\" % (name, (end - start) / samples))\n", "\n", "\n", "# measure_execution_time(\"openai-whisper\", run_openai_whisper)\n", "measure_execution_time(\"faster-whisper\", run_faster_whisper)\n", "measure_execution_time(\"lora-whisper\", run_lora_whisper)\n", "measure_execution_time(\"hf-whisper\", run_hf_whisper)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "# MITI quantized" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "420it [00:02, 153.21it/s]\n" ] } ], "source": [ "import logging\n", "import numpy as np\n", "import datasets\n", "from datasets import DatasetDict, load_dataset, concatenate_datasets\n", "from tqdm import tqdm\n", "from transformers import (\n", " AutoConfig,\n", " AutoFeatureExtractor,\n", " AutoModelForSpeechSeq2Seq,\n", " AutoTokenizer,\n", " set_seed,\n", ")\n", "from transformers.utils.versions import require_version\n", "from transformers.utils import check_min_version\n", "from tqdm import tqdm\n", "\n", "\n", "\n", "\n", "logger = logging.getLogger(__name__)\n", "from datasets import Dataset, DatasetDict\n", "import torchaudio\n", "from torchaudio import transforms as at\n", "import pandas as pd\n", "import torch\n", "from pathlib import Path\n", "\n", "def main():\n", " set_seed(42)\n", "\n", "\n", " max_input_length = 30.0 * 16000\n", " min_input_length = 0.0 * 16000\n", " audio_column_name = \"audio\"\n", " text_column_name = \"text\"\n", "\n", "\n", "\n", "\n", "\n", " def load_wave(wave_path, sample_rate:int=16000) -> np.ndarray:\n", " waveform, sr = torchaudio.load(wave_path, normalize=True)\n", " if sample_rate != sr:\n", " waveform = at.Resample(sr, sample_rate)(waveform)\n", " return np.asarray(waveform)\n", " \n", "\n", " def get_list_files_MITI(phase, sample_rate=16000, audio_max_sample_length=480000):\n", " text_list = []\n", " path_list = []\n", " if phase == 'train':\n", " csv_file = 'MITI_train.csv'\n", " else:\n", " csv_file = 'MITI_test.csv'\n", " df = pd.read_csv(csv_file)\n", " for index, row in tqdm(df.iterrows()):\n", " path = row['path']\n", " new_path = Path(row['path'])\n", " audio_id = index\n", " text = row['sentence']\n", " if new_path.exists():\n", " audio = load_wave(new_path, sample_rate=sample_rate)[0]\n", " if len(audio) > audio_max_sample_length or len(audio) < 0:\n", " print('skip file:', new_path,'with len audio', len(audio))\n", " del new_path\n", " continue\n", " text_list.append(text)\n", " path_list.append(path) \n", "\n", " return path_list, text_list\n", "\n", "\n", "\n", "\n", " # Get the testing dataset\n", " test_audio, test_text = get_list_files_MITI(phase='test')\n", " #print(test_audio[0])\n", " test_dataset = Dataset.from_dict({\"audio\": test_audio, \"text\": test_text})\n", " MITI = DatasetDict({\"test\": test_dataset})\n", " #print(clean_data)\n", "\n", "\n", " return MITI, test_dataset\n", "\n", "\n", "if __name__ == \"__main__\":\n", " clean_data, test_dataset = main()" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import torch\n", "from dataclasses import dataclass\n", "\n", "@dataclass\n", "class DataCollatorSpeechSeq2SeqWithPadding:\n", "\n", " def __call__(self, features):\n", " batch = {\n", " \"audio\": [feature[\"audio\"] for feature in features],\n", " \"transcription\": [feature[\"text\"] for feature in features]\n", " }\n", " return batch\n", "data_collator = DataCollatorSpeechSeq2SeqWithPadding()" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "DatasetDict({\n", " test: Dataset({\n", " features: ['audio', 'text'],\n", " num_rows: 420\n", " })\n", "})" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "clean_data" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "from whisper_quant import WhisperModel\n", "\n", "model_size = \"medium\"\n", "\n", "# Run on GPU with FP16\n", "model = WhisperModel(model_size, device=\"cuda\", compute_type=\"float16\")" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ " 0%| | 0/27 [00:00