{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "# Text-to-Speech synthesis using OuteTTS and OpenVINO\n", "\n", "
Important note: This notebook requires python >= 3.10. Please make sure that your environment fulfill to this requirement before running it
\n", "\n", "[OuteTTS-0.1-350M](https://huggingface.co/OuteAI/OuteTTS-0.1-350M) is a novel text-to-speech synthesis model that leverages pure language modeling without external adapters or complex architectures, built upon the LLaMa architecture. It demonstrates that high-quality speech synthesis is achievable through a straightforward approach using crafted prompts and audio tokens.\n", "\n", "More details about model can be found in [original repo](https://github.com/edwko/OuteTTS).\n", "\n", "In this tutorial we consider how to run OuteTTS pipeline using OpenVINO.\n", "\n", "#### Table of contents:\n", "\n", "- [Prerequisites](#Prerequisites)\n", "- [Convert model](#Convert-model)\n", "- [Run model inference](#Run-model-inference)\n", " - [Text-to-Speech generation](#Text-to-Speech-generation)\n", " - [Text-to-Speech generation with Voice Cloning](#Text-to-Speech-generation-with-Voice-Cloning)\n", "- [Quantization](#Quantization)\n", " - [Prepare calibration dataset](#Prepare-calibration-dataset)\n", " - [Quantize model](#Quantize-model)\n", " - [Verifying quantized model execution](#Verifying-quantized-model-execution)\n", " - [Comparing original and quantized model performance](#Comparing-model-performance)\n", "- [Interactive demo](#Interactive-demo)\n", "\n", "\n", "### Installation Instructions\n", "\n", "This is a self-contained example that relies solely on its own code.\n", "\n", "We recommend running the notebook in a virtual environment. You only need a Jupyter server to start.\n", "For details, please refer to [Installation Guide](https://github.com/openvinotoolkit/openvino_notebooks/blob/latest/README.md#-installation-guide).\n", "\n", "\n" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Prerequisites\n", "[back to top ⬆️](#Table-of-contents:)" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import requests\n", "from pathlib import Path\n", "\n", "utility_files = [\"skip_kernel_extension.py\", \"cmd_helper.py\", \"notebook_utils.py\", \"pip_helper.py\"]\n", "base_utility_url = \"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/utils/\"\n", "\n", "for utility_file in utility_files:\n", " if not Path(utility_file).exists():\n", " r = requests.get(base_utility_url + utility_file)\n", " with Path(utility_file).open(\"w\") as f:\n", " f.write(r.text)\n", "\n", "\n", "helper_files = [\"gradio_helper.py\", \"ov_outetts_helper.py\"]\n", "base_helper_url = \"https://raw.githubusercontent.com/openvinotoolkit/openvino_notebooks/latest/notebooks/outetts-text-to-speech\"\n", "\n", "for helper_file in helper_files:\n", " if not Path(helper_file).exists():\n", " r = requests.get(base_helper_url + helper_file)\n", " with Path(helper_file).open(\"w\") as f:\n", " f.write(r.text)\n", "\n", "%load_ext skip_kernel_extension" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import platform\n", "from pip_helper import pip_install\n", "\n", "pip_install(\n", " \"-q\",\n", " \"torch>=2.1\",\n", " \"torchaudio\",\n", " \"einops\",\n", " \"transformers>=4.46.1\",\n", " \"loguru\",\n", " \"inflect\",\n", " \"pesq\",\n", " \"torchcrepe\",\n", " \"natsort\",\n", " \"polars\",\n", " \"uroman\",\n", " \"mecab-python3\",\n", " \"openai-whisper>=20240930\",\n", " \"unidic-lite\",\n", " \"--extra-index-url\",\n", " \"https://download.pytorch.org/whl/cpu\",\n", ")\n", "pip_install(\n", " \"-q\",\n", " \"gradio>=4.19\",\n", " \"openvino>=2024.4.0\",\n", " \"tqdm\",\n", " \"pyyaml\",\n", " \"librosa\",\n", " \"soundfile\",\n", " \"nncf\",\n", ")\n", "pip_install(\"-q\", \"git+https://github.com/huggingface/optimum-intel.git\", \"--extra-index-url\", \"https://download.pytorch.org/whl/cpu\")\n", "\n", "if platform.system() == \"Darwin\":\n", " pip_install(\"-q\", \"numpy<2.0.0\")" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "# Read more about telemetry collection at https://github.com/openvinotoolkit/openvino_notebooks?tab=readme-ov-file#-telemetry\n", "from notebook_utils import collect_telemetry\n", "\n", "collect_telemetry(\"outetts-text-to-speech.ipynb\")" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "from cmd_helper import clone_repo\n", "\n", "repo_path = clone_repo(\"https://github.com/edwko/OuteTTS.git\", revision=\"0.3.2\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "%pip install -q {repo_path} --extra-index-url https://download.pytorch.org/whl/cpu" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Convert model\n", "[back to top ⬆️](#Table-of-contents:)\n", "\n", "\n", " OpenVINO supports PyTorch models via conversion to OpenVINO Intermediate Representation format. For convenience, we will use OpenVINO integration with HuggingFace Optimum. πŸ€— [Optimum Intel](https://huggingface.co/docs/optimum/intel/index) is the interface between the πŸ€— Transformers and Diffusers libraries and the different tools and libraries provided by Intel to accelerate end-to-end pipelines on Intel architectures.\n", "\n", "Among other use cases, Optimum Intel provides a simple interface to optimize your Transformers and Diffusers models, convert them to the OpenVINO Intermediate Representation (IR) format and run inference using OpenVINO Runtime. `optimum-cli` provides command line interface for model conversion and optimization. \n", "\n", "General command format:\n", "\n", "```bash\n", "optimum-cli export openvino --model --task \n", "```\n", "\n", "where task is task to export the model for, if not specified, the task will be auto-inferred based on the model. You can find a mapping between tasks and model classes in Optimum TaskManager [documentation](https://huggingface.co/docs/optimum/exporters/task_manager). Additionally, you can specify weights compression using `--weight-format` argument with one of following options: `fp32`, `fp16`, `int8` and `int4`. Fro int8 and int4 [nncf](https://github.com/openvinotoolkit/nncf) will be used for weight compression. More details about model export provided in [Optimum Intel documentation](https://huggingface.co/docs/optimum/intel/openvino/export#export-your-model).\n", "\n", "As OuteTTS utilizes pure language modeling approach, model conversion process remains the same like conversion LLaMa models family for text generation purposes." ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "from cmd_helper import optimum_cli\n", "from pathlib import Path\n", "\n", "model_id = \"OuteAI/OuteTTS-0.1-350M\"\n", "model_dir = Path(model_id.split(\"/\")[-1] + \"-ov\")\n", "\n", "if not model_dir.exists():\n", " optimum_cli(model_id, model_dir, additional_args={\"task\": \"text-generation-with-past\"})" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Run model inference\n", "[back to top ⬆️](#Table-of-contents:)\n", "\n", "\n", "OpenVINO integration with Optimum Intel provides ready-to-use API for model inference that can be used for smooth integration with transformers-based solutions. For loading model, we will use `OVModelForCausalLM` class that have compatible interface with Transformers LLaMa implementation. For loading a model, `from_pretrained` method should be used. It accepts path to the model directory or model_id from HuggingFace hub (if model is not converted to OpenVINO format, conversion will be triggered automatically). Additionally, we can provide an inference device, quantization config (if model has not been quantized yet) and device-specific OpenVINO Runtime configuration. More details about model inference with Optimum Intel can be found in [documentation](https://huggingface.co/docs/optimum/intel/openvino/inference). We will use `OVModelForCausalLM` as replacement of original `AutoModelForCausalLM` in `InterfaceHF`.\n" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "5bf3ac70181a48d1948c3450b53d25f1", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Dropdown(description='Device:', index=1, options=('CPU', 'AUTO'), value='AUTO')" ] }, "execution_count": 7, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from notebook_utils import device_widget\n", "\n", "device = device_widget(exclude=[\"NPU\"])\n", "\n", "device" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "/home/ea/work/my_optimum_intel/optimum_env_new/lib/python3.11/site-packages/awq/__init__.py:21: DeprecationWarning: \n", "I have left this message as the final dev message to help you transition.\n", "\n", "Important Notice:\n", "- AutoAWQ is officially deprecated and will no longer be maintained.\n", "- The last tested configuration used Torch 2.6.0 and Transformers 4.51.3.\n", "- If future versions of Transformers break AutoAWQ compatibility, please report the issue to the Transformers project.\n", "\n", "Alternative:\n", "- AutoAWQ has been adopted by the vLLM Project: https://github.com/vllm-project/llm-compressor\n", "\n", "For further inquiries, feel free to reach out:\n", "- X: https://x.com/casper_hansen_\n", "- LinkedIn: https://www.linkedin.com/in/casper-hansen-804005170/\n", "\n", " warnings.warn(_FINAL_DEV_MESSAGE, category=DeprecationWarning, stacklevel=1)\n", "\u001b[32m2025-05-16 08:30:26.721\u001b[0m | \u001b[33m\u001b[1mWARNING \u001b[0m | \u001b[36moutetts.version.playback\u001b[0m:\u001b[36m\u001b[0m:\u001b[36m11\u001b[0m - \u001b[33m\u001b[1m[playback] Failed to import sounddevice.\u001b[0m\n", "\u001b[32m2025-05-16 08:30:26.722\u001b[0m | \u001b[33m\u001b[1mWARNING \u001b[0m | \u001b[36moutetts.version.playback\u001b[0m:\u001b[36m\u001b[0m:\u001b[36m15\u001b[0m - \u001b[33m\u001b[1m[playback] Failed to pygame sounddevice.\u001b[0m\n" ] } ], "source": [ "from ov_outetts_helper import InterfaceOV, OVHFModel # noqa: F401\n", "\n", "# Uncomment these lines to see pipeline details\n", "# ??InterfaceOV\n", "# ??OVHFModel" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "making attention of type 'vanilla' with 768 in_channels\n" ] } ], "source": [ "interface = InterfaceOV(model_dir, device.value)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### Text-to-Speech generation\n", "[back to top ⬆️](#Table-of-contents:)\n", "\n", "\n", "Now let's see model in action. Providing input text to `generate` method of interface, model returns tensor that represents output audio with random speaker characteristics." ] }, { "cell_type": "code", "execution_count": 10, "metadata": { "scrolled": true }, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "The attention mask and the pad token id were not set. As a consequence, you may observe unexpected behavior. Please pass your input's `attention_mask` to obtain reliable results.\n", "Setting `pad_token_id` to `eos_token_id`:2 for open-end generation.\n", "The attention mask is not set and cannot be inferred from input because pad token is same as eos token. As a consequence, you may observe unexpected behavior. Please pass your input's `attention_mask` to obtain reliable results.\n" ] } ], "source": [ "tts_output = interface.generate(text=\"Hello, I'm working!\", temperature=0.1, repetition_penalty=1.1, max_length=4096)" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import IPython.display as ipd\n", "\n", "\n", "def play(data, rate=None):\n", " ipd.display(ipd.Audio(data, rate=rate))\n", "\n", "\n", "play(tts_output.audio[0].numpy(), rate=tts_output.sr)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### Text-to-Speech generation with Voice Cloning\n", "[back to top ⬆️](#Table-of-contents:)\n", "\n", "\n", "Additionally, we can specify reference voice for generation by providing reference audio and transcript for it. `interface.create_speaker` processes reference audio and text to set of features used for audio description." ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [], "source": [ "from notebook_utils import download_file\n", "\n", "ref_audio_url = \"https://huggingface.co/OuteAI/OuteTTS-0.1-350M/resolve/main/samples/2.wav\"\n", "file_path = Path(\"2.wav\")\n", "\n", "if not file_path.exists():\n", " file_path = download_file(ref_audio_url)" ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "play(file_path)" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "The attention mask and the pad token id were not set. As a consequence, you may observe unexpected behavior. Please pass your input's `attention_mask` to obtain reliable results.\n", "Setting `pad_token_id` to `eos_token_id`:2 for open-end generation.\n" ] } ], "source": [ "speaker = interface.create_speaker(file_path, \"Hello, I can speak pretty well, but sometimes I make some mistakes.\")\n", "\n", "# Save the speaker to a file\n", "interface.save_speaker(speaker, \"speaker.pkl\")\n", "\n", "# Load the speaker from a file\n", "speaker = interface.load_speaker(\"speaker.pkl\")\n", "\n", "# Generate TTS with the custom voice\n", "cloned_output = interface.generate(\n", " text=\"This is a cloned voice speaking\",\n", " speaker=speaker,\n", " temperature=0.1,\n", " repetition_penalty=1.1,\n", " max_length=4096,\n", ")" ] }, { "cell_type": "code", "execution_count": 15, "metadata": {}, "outputs": [ { "data": { "text/html": [ "\n", " \n", " " ], "text/plain": [ "" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "play(cloned_output.audio[0].numpy(), rate=cloned_output.sr)" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "## Quantization\n", "[back to top ⬆️](#Table-of-contents:)\n", "\n", "\n", "[NNCF](https://github.com/openvinotoolkit/nncf/) enables post-training quantization by adding the quantization layers into the model graph and then using a subset of the training dataset to initialize the parameters of these additional quantization layers. The framework is designed so that modifications to your original training code are minor.\n", "\n", "The optimization process contains the following steps:\n", "\n", "1. Create a calibration dataset for quantization.\n", "2. Run `nncf.quantize` to obtain quantized model.\n", "3. Serialize the `INT8` model.\n", "\n", "Note: Quantization is a time and memory-consuming operation. Running the quantization code below may take some time." ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "3d431b75a9d74ac2bbf144355b6ac7b1", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Checkbox(value=True, description='Quantization')" ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "from notebook_utils import quantization_widget\n", "\n", "to_quantize = quantization_widget()\n", "\n", "to_quantize" ] }, { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "### Prepare calibration dataset\n", "[back to top ⬆️](#Table-of-contents:)\n", "\n", "The first step is to prepare calibration datasets for quantization. We will utilize [Filtered LibriTTS-R](https://huggingface.co/datasets/parler-tts/libritts_r_filtered) dataset as it was used to train the original model." ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "0a0747c303214974b903451f8536ef3e", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Resolving data files: 0%| | 0/18 [00:00\n" ], "text/plain": [] }, "metadata": {}, "output_type": "display_data" }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "05bc61473ee642fcb074e9f5370e24ca", "version_major": 2, "version_minor": 0 }, "text/plain": [ "Output()" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n"
      ],
      "text/plain": []
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "INFO:nncf:20 ignored nodes were found by patterns in the NNCFGraph\n",
      "INFO:nncf:Not adding activation input quantizer for operation: 367 __module.model.layers.0.self_attn/aten::scaled_dot_product_attention/ScaledDotProductAttention\n",
      "INFO:nncf:Not adding activation input quantizer for operation: 368 __module.model.layers.1.self_attn/aten::scaled_dot_product_attention/ScaledDotProductAttention\n",
      "INFO:nncf:Not adding activation input quantizer for operation: 369 __module.model.layers.2.self_attn/aten::scaled_dot_product_attention/ScaledDotProductAttention\n",
      "INFO:nncf:Not adding activation input quantizer for operation: 370 __module.model.layers.3.self_attn/aten::scaled_dot_product_attention/ScaledDotProductAttention\n",
      "INFO:nncf:Not adding activation input quantizer for operation: 371 __module.model.layers.4.self_attn/aten::scaled_dot_product_attention/ScaledDotProductAttention\n",
      "INFO:nncf:Not adding activation input quantizer for operation: 372 __module.model.layers.5.self_attn/aten::scaled_dot_product_attention/ScaledDotProductAttention\n",
      "INFO:nncf:Not adding activation input quantizer for operation: 373 __module.model.layers.6.self_attn/aten::scaled_dot_product_attention/ScaledDotProductAttention\n",
      "INFO:nncf:Not adding activation input quantizer for operation: 374 __module.model.layers.7.self_attn/aten::scaled_dot_product_attention/ScaledDotProductAttention\n",
      "INFO:nncf:Not adding activation input quantizer for operation: 375 __module.model.layers.8.self_attn/aten::scaled_dot_product_attention/ScaledDotProductAttention\n",
      "INFO:nncf:Not adding activation input quantizer for operation: 376 __module.model.layers.9.self_attn/aten::scaled_dot_product_attention/ScaledDotProductAttention\n",
      "INFO:nncf:Not adding activation input quantizer for operation: 377 __module.model.layers.10.self_attn/aten::scaled_dot_product_attention/ScaledDotProductAttention\n",
      "INFO:nncf:Not adding activation input quantizer for operation: 378 __module.model.layers.11.self_attn/aten::scaled_dot_product_attention/ScaledDotProductAttention\n",
      "INFO:nncf:Not adding activation input quantizer for operation: 379 __module.model.layers.12.self_attn/aten::scaled_dot_product_attention/ScaledDotProductAttention\n",
      "INFO:nncf:Not adding activation input quantizer for operation: 380 __module.model.layers.13.self_attn/aten::scaled_dot_product_attention/ScaledDotProductAttention\n",
      "INFO:nncf:Not adding activation input quantizer for operation: 381 __module.model.layers.14.self_attn/aten::scaled_dot_product_attention/ScaledDotProductAttention\n",
      "INFO:nncf:Not adding activation input quantizer for operation: 382 __module.model.layers.15.self_attn/aten::scaled_dot_product_attention/ScaledDotProductAttention\n",
      "INFO:nncf:Not adding activation input quantizer for operation: 383 __module.model.layers.16.self_attn/aten::scaled_dot_product_attention/ScaledDotProductAttention\n",
      "INFO:nncf:Not adding activation input quantizer for operation: 384 __module.model.layers.17.self_attn/aten::scaled_dot_product_attention/ScaledDotProductAttention\n",
      "INFO:nncf:Not adding activation input quantizer for operation: 385 __module.model.layers.18.self_attn/aten::scaled_dot_product_attention/ScaledDotProductAttention\n",
      "INFO:nncf:Not adding activation input quantizer for operation: 386 __module.model.layers.19.self_attn/aten::scaled_dot_product_attention/ScaledDotProductAttention\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "baf27312b5ec4cd9839240b1d83786c5",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Output()"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "
\n"
      ],
      "text/plain": []
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%skip not $to_quantize.value\n",
    "\n",
    "import nncf\n",
    "from functools import partial\n",
    "import numpy as np\n",
    "\n",
    "def transform_fn(item, interface):\n",
    "    text_normalized = item[\"text_normalized\"]\n",
    "    prompt = interface.prompt_processor.get_completion_prompt(text_normalized, interface.language, None)\n",
    "    encoded = interface.prompt_processor.tokenizer(prompt, return_tensors=\"np\")\n",
    "\n",
    "    input_ids = encoded[\"input_ids\"]\n",
    "    attention_mask = encoded[\"attention_mask\"]\n",
    "    inputs = {\"input_ids\": input_ids, \"attention_mask\": attention_mask}\n",
    "\n",
    "    position_ids = np.cumsum(attention_mask, axis=1) - 1\n",
    "    position_ids[attention_mask == 0] = 1\n",
    "    inputs[\"position_ids\"] = position_ids\n",
    "\n",
    "    batch_size = input_ids.shape[0]\n",
    "    inputs[\"beam_idx\"] = np.arange(batch_size, dtype=int)\n",
    "\n",
    "    return inputs\n",
    "\n",
    "hf_model = OVHFModel(model_dir, device.value).model\n",
    "dataset = nncf.Dataset(libritts, partial(transform_fn, interface=interface))\n",
    "\n",
    "quantized_model = nncf.quantize(\n",
    "    hf_model.model,\n",
    "    dataset,\n",
    "    preset=nncf.QuantizationPreset.MIXED,\n",
    "    model_type=nncf.ModelType.TRANSFORMER,\n",
    "    ignored_scope=nncf.IgnoredScope(\n",
    "        patterns=[\n",
    "            # We need to use ignored scope for this pattern to generate the most efficient model\n",
    "            \"__module.model.layers.*.self_attn/aten::scaled_dot_product_attention/ScaledDotProductAttention\"\n",
    "        ]\n",
    "    )\n",
    ")\n",
    "\n",
    "hf_model.model = quantized_model\n",
    "model_dir_quantized = Path(f\"{model_dir}_quantized\")\n",
    "hf_model.save_pretrained(model_dir_quantized)\n",
    "interface.prompt_processor.tokenizer.save_pretrained(model_dir_quantized)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Verifying quantized model execution\n",
    "[back to top ⬆️](#Table-of-contents:)\n",
    "\n",
    "In order to verify the quality of the quantized model, we will generate outputs based on the same texts and speakers used for the non-quantized model.\n",
    "First, we will save the quantized model and recreate the pipelines for validation.\n",
    "Then we will generate the outputs and try to compare them with the previously obtained outputs."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "making attention of type 'vanilla' with 768 in_channels\n"
     ]
    }
   ],
   "source": [
    "%%skip not $to_quantize.value\n",
    "\n",
    "interface_quantized = InterfaceOV(model_dir_quantized, device.value)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "The attention mask and the pad token id were not set. As a consequence, you may observe unexpected behavior. Please pass your input's `attention_mask` to obtain reliable results.\n",
      "Setting `pad_token_id` to `eos_token_id`:2 for open-end generation.\n"
     ]
    }
   ],
   "source": [
    "%%skip not $to_quantize.value\n",
    "\n",
    "tts_output_quantized = interface_quantized.generate(text=\"Hello, I'm working!\", temperature=0.1, repetition_penalty=1.1, max_length=4096)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "                \n",
       "              "
      ],
      "text/plain": [
       ""
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%skip not $to_quantize.value\n",
    "# Non-quantized model output:\n",
    "play(tts_output.audio[0].numpy(), rate=tts_output.sr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "                \n",
       "              "
      ],
      "text/plain": [
       ""
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%skip not $to_quantize.value\n",
    "# Quantized model output:\n",
    "play(tts_output_quantized.audio[0].numpy(), rate=tts_output_quantized.sr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "The attention mask and the pad token id were not set. As a consequence, you may observe unexpected behavior. Please pass your input's `attention_mask` to obtain reliable results.\n",
      "Setting `pad_token_id` to `eos_token_id`:2 for open-end generation.\n"
     ]
    }
   ],
   "source": [
    "%%skip not $to_quantize.value\n",
    "\n",
    "speaker_quantized = interface_quantized.load_speaker(\"speaker.pkl\")\n",
    "cloned_output_quantized = interface_quantized.generate(\n",
    "    text=\"This is a cloned voice speaking\",\n",
    "    speaker=speaker,\n",
    "    temperature=0.1,\n",
    "    repetition_penalty=1.1,\n",
    "    max_length=4096,\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "                \n",
       "              "
      ],
      "text/plain": [
       ""
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%skip not $to_quantize.value\n",
    "# Non-quantized model output:\n",
    "play(cloned_output.audio[0].numpy(), rate=cloned_output.sr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "                \n",
       "              "
      ],
      "text/plain": [
       ""
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%%skip not $to_quantize.value\n",
    "# Quantized model output:\n",
    "play(cloned_output_quantized.audio[0].numpy(), rate=cloned_output_quantized.sr)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Comparing model performance\n",
    "[back to top ⬆️](#Table-of-contents:)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "making attention of type 'vanilla' with 768 in_channels\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "26it [02:05,  4.82s/it]                                                                                                                                                                                                                                                               \n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Original model generate time: 5.085656422015745\n",
      "making attention of type 'vanilla' with 768 in_channels\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      " 16%|β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹                                                                                                                                                                                                           | 4/25 [00:19<01:27,  4.16s/it]"
     ]
    }
   ],
   "source": [
    "%%skip not $to_quantize.value\n",
    "\n",
    "import time\n",
    "import tqdm\n",
    "\n",
    "def calculate_inference_time(interface, dataset, limit):\n",
    "    inference_time = []\n",
    "    for i, item in tqdm.tqdm(enumerate(dataset), total=limit):\n",
    "        if i > limit: break\n",
    "        start = time.perf_counter()\n",
    "        _ = interface.generate(\n",
    "            text=item[\"text_normalized\"],\n",
    "            max_length=256,\n",
    "            additional_gen_config={\n",
    "                \"pad_token_id\": interface.prompt_processor.tokenizer.eos_token_id\n",
    "            }\n",
    "        )\n",
    "        end = time.perf_counter()\n",
    "        delta = end - start\n",
    "        inference_time.append(delta)\n",
    "    return np.median(inference_time)\n",
    "\n",
    "interface = InterfaceOV(model_dir, device.value)\n",
    "limit = 25\n",
    "\n",
    "fp_inference_time = calculate_inference_time(interface, libritts, limit)\n",
    "print(f\"Original model generate time: {fp_inference_time}\")\n",
    "\n",
    "interface_quantized = InterfaceOV(model_dir_quantized, device.value)\n",
    "int_inference_time = calculate_inference_time(interface_quantized, libritts, limit)\n",
    "print(f\"Quantized model generate time: {int_inference_time}\")"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Interactive demo\n",
    "[back to top ⬆️](#Table-of-contents:)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import ipywidgets as widgets\n",
    "\n",
    "quantized_model_present = model_dir_quantized.exists()\n",
    "\n",
    "use_quantized_model = widgets.Checkbox(\n",
    "    value=True if quantized_model_present else False,\n",
    "    description=\"Use quantized model\",\n",
    "    disabled=False,\n",
    ")\n",
    "\n",
    "use_quantized_model"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from gradio_helper import make_demo\n",
    "\n",
    "if use_quantized_model:\n",
    "    demo_interface = InterfaceOV(model_dir_quantized, device.value)\n",
    "else:\n",
    "    demo_interface = InterfaceOV(model_dir, device.value)\n",
    "\n",
    "demo = make_demo(demo_interface)\n",
    "\n",
    "try:\n",
    "    demo.launch(debug=True)\n",
    "except Exception:\n",
    "    demo.launch(share=True, debug=True)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "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.11.4"
  },
  "openvino_notebooks": {
   "imageUrl": "https://github.com/user-attachments/assets/2c667441-c32b-4cb0-8c28-390120b917b3",
   "tags": {
    "categories": [
     "Model Demos"
    ],
    "libraries": [],
    "other": [
     "Transformers"
    ],
    "tasks": [
     "Text-to-Audio",
     "Text-to-Speech"
    ]
   }
  },
  "widgets": {
   "application/vnd.jupyter.widget-state+json": {
    "state": {
     "03f8e3b8fc6b45d4a0b8a9e9a8d53af6": {
      "model_module": "@jupyter-widgets/base",
      "model_module_version": "2.0.0",
      "model_name": "LayoutModel",
      "state": {}
     },
     "05bc61473ee642fcb074e9f5370e24ca": {
      "model_module": "@jupyter-widgets/output",
      "model_module_version": "1.0.0",
      "model_name": "OutputModel",
      "state": {
       "layout": "IPY_MODEL_e448846d240a445fb1ac0613f882110b",
       "outputs": [
        {
         "data": {
          "text/html": "
Applying Smooth Quant ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 81/81 β€’ 0:00:03 β€’ 0:00:00\n
\n", "text/plain": "Applying Smooth Quant \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[35m100%\u001b[0m \u001b[38;2;0;104;181m81/81\u001b[0m β€’ \u001b[38;2;0;104;181m0:00:03\u001b[0m β€’ \u001b[38;2;0;104;181m0:00:00\u001b[0m\n" }, "metadata": {}, "output_type": "display_data" } ] } }, "0a0747c303214974b903451f8536ef3e": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HBoxModel", "state": { "children": [ "IPY_MODEL_cfbd848440744d58bab28a023f3cbba8", "IPY_MODEL_73d89fa1f5f745d88f3b37707044699c", "IPY_MODEL_7903fcdf0e794bb6ac57ecbe04b70a7c" ], "layout": "IPY_MODEL_c0254c2463df4fd5aef2b711661f43a6" } }, "0fa0b43b5ac744c68939ac111716bec0": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {} }, "10a7bc89ea914710a88cb69b4e4455f6": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {} }, "1217c78e539c45bab8ebf7586868fc75": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "ProgressStyleModel", "state": { "description_width": "" } }, "13d146dbc5744531aeee344d4ae49a34": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HTMLStyleModel", "state": { "description_width": "", "font_size": null, "text_color": null } }, "1ea595f5d8054bb49236c8404d56a98e": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "DescriptionStyleModel", "state": { "description_width": "" } }, "221d9ff157c247dfb5ca12594daf4009": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {} }, "2236c6818baa471495f4b10fb3ba6fb6": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "ProgressStyleModel", "state": { "description_width": "" } }, "26f2522771014451a644d901c889c08f": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "FloatProgressModel", "state": { "bar_style": "success", "layout": "IPY_MODEL_03f8e3b8fc6b45d4a0b8a9e9a8d53af6", "max": 18, "style": "IPY_MODEL_a7028c8a1d5d40148bf3461e903a02a8", "value": 18 } }, "27527e0bea6049c48fda1b6c1f8dac1a": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {} }, "2d0bd87168e749b18d2881a1deff4b65": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {} }, "3025bd469e6d4d9f9254ecbb473a37cc": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HTMLModel", "state": { "layout": "IPY_MODEL_7d638cc7601a4937adccb5237a28bff3", "style": "IPY_MODEL_57c33e31fe58443fb207a5806fcea0c8", "value": " 64/64 [00:01<00:00,  1.48s/it]" } }, "3d431b75a9d74ac2bbf144355b6ac7b1": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "CheckboxModel", "state": { "description": "Quantization", "disabled": false, "layout": "IPY_MODEL_e965f9a1aa174357b8cf7a8baa20351a", "style": "IPY_MODEL_7d05f37bf36a4ad4a18ea7d24ccb9911", "value": true } }, "53e10cd7b624418eb1c6bf1eb5befeb6": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {} }, "57c33e31fe58443fb207a5806fcea0c8": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HTMLStyleModel", "state": { "description_width": "", "font_size": null, "text_color": null } }, "5bf3ac70181a48d1948c3450b53d25f1": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "DropdownModel", "state": { "_options_labels": [ "CPU", "AUTO" ], "description": "Device:", "index": 1, "layout": "IPY_MODEL_9509c71f4a664fa582cfda1a65c0bf2e", "style": "IPY_MODEL_1ea595f5d8054bb49236c8404d56a98e" } }, "5d5bc82c548442b38c89894803f6bdd7": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {} }, "5db9284af44240a58445da7e3f84ae3a": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HTMLModel", "state": { "layout": "IPY_MODEL_fbb8ab75f03a457e9911ff8620b377c6", "style": "IPY_MODEL_e8ac336790a64289a3b3b3df96cd1ac1", "value": "Resolving data files: 100%" } }, "5e7b55e5bc19459f9669531ccc30fc8d": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HTMLStyleModel", "state": { "description_width": "", "font_size": null, "text_color": null } }, "619834f15d274b3db33dbad14e61970d": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {} }, "722a726e76bc4b5187e83d10393b2bf1": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "FloatProgressModel", "state": { "bar_style": "success", "layout": "IPY_MODEL_b85cf1e379434ae39890b57002ba2fc4", "max": 64, "style": "IPY_MODEL_1217c78e539c45bab8ebf7586868fc75", "value": 64 } }, "73d89fa1f5f745d88f3b37707044699c": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "FloatProgressModel", "state": { "bar_style": "success", "layout": "IPY_MODEL_5d5bc82c548442b38c89894803f6bdd7", "max": 18, "style": "IPY_MODEL_a1af29a31634478e97755914998ea30d", "value": 18 } }, "7540abda877a43d298cbdd9cb236f89e": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {} }, "7903fcdf0e794bb6ac57ecbe04b70a7c": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HTMLModel", "state": { "layout": "IPY_MODEL_2d0bd87168e749b18d2881a1deff4b65", "style": "IPY_MODEL_e7235f2adb4f4a8faa1e1e214ed3ed10", "value": " 18/18 [00:00<00:00, 1931.87it/s]" } }, "7d05f37bf36a4ad4a18ea7d24ccb9911": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "CheckboxStyleModel", "state": { "description_width": "" } }, "7d638cc7601a4937adccb5237a28bff3": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {} }, "7d96ebb96d904a079e480616f88e3842": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {} }, "7e5b42bb8a0c4e58b370376888312e7c": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HTMLModel", "state": { "layout": "IPY_MODEL_e45cba8bfa8449f6aeb41539b32efe47", "style": "IPY_MODEL_8a3ce6e7a3244964af508c7172db9b97", "value": " 64/64 [00:02<00:00,  4.60it/s]" } }, "7eea49c01360448ab8405a065b3e4b68": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "FloatProgressModel", "state": { "bar_style": "success", "layout": "IPY_MODEL_7540abda877a43d298cbdd9cb236f89e", "max": 64, "style": "IPY_MODEL_2236c6818baa471495f4b10fb3ba6fb6", "value": 64 } }, "8480dfbd6ebb47aea26810b3b09d0442": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HBoxModel", "state": { "children": [ "IPY_MODEL_bc55f2f7c4a247ebba3c172804118716", "IPY_MODEL_26f2522771014451a644d901c889c08f", "IPY_MODEL_d4edd971f8b34925bb49610234292feb" ], "layout": "IPY_MODEL_619834f15d274b3db33dbad14e61970d" } }, "8a3ce6e7a3244964af508c7172db9b97": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HTMLStyleModel", "state": { "description_width": "", "font_size": null, "text_color": null } }, "9509c71f4a664fa582cfda1a65c0bf2e": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {} }, "a1af29a31634478e97755914998ea30d": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "ProgressStyleModel", "state": { "description_width": "" } }, "a44a36aa906c43e8bf36e41bdae36d17": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HBoxModel", "state": { "children": [ "IPY_MODEL_f7daeee851494a9b93c7ccab59179e18", "IPY_MODEL_722a726e76bc4b5187e83d10393b2bf1", "IPY_MODEL_7e5b42bb8a0c4e58b370376888312e7c" ], "layout": "IPY_MODEL_221d9ff157c247dfb5ca12594daf4009" } }, "a7028c8a1d5d40148bf3461e903a02a8": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "ProgressStyleModel", "state": { "description_width": "" } }, "b85cf1e379434ae39890b57002ba2fc4": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {} }, "baf27312b5ec4cd9839240b1d83786c5": { "model_module": "@jupyter-widgets/output", "model_module_version": "1.0.0", "model_name": "OutputModel", "state": { "layout": "IPY_MODEL_10a7bc89ea914710a88cb69b4e4455f6", "outputs": [ { "data": { "text/html": "
Statistics collection ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 300/300 β€’ 0:00:26 β€’ 0:00:00\n
\n", "text/plain": "Statistics collection \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[35m100%\u001b[0m \u001b[38;2;0;104;181m300/300\u001b[0m β€’ \u001b[38;2;0;104;181m0:00:26\u001b[0m β€’ \u001b[38;2;0;104;181m0:00:00\u001b[0m\n" }, "metadata": {}, "output_type": "display_data" } ] } }, "bb5490c465384ca2bda0effdfcd363b5": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HTMLStyleModel", "state": { "description_width": "", "font_size": null, "text_color": null } }, "bc55f2f7c4a247ebba3c172804118716": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HTMLModel", "state": { "layout": "IPY_MODEL_bff57cdc5a2c49748f42b4dd71544644", "style": "IPY_MODEL_c8de13d7778c42289d4d3119e2d9d29c", "value": "Resolving data files: 100%" } }, "bff57cdc5a2c49748f42b4dd71544644": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {} }, "c0254c2463df4fd5aef2b711661f43a6": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {} }, "c8de13d7778c42289d4d3119e2d9d29c": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HTMLStyleModel", "state": { "description_width": "", "font_size": null, "text_color": null } }, "cb870ae58a564e1888744f9e0e96ce5f": { "model_module": "@jupyter-widgets/output", "model_module_version": "1.0.0", "model_name": "OutputModel", "state": { "layout": "IPY_MODEL_0fa0b43b5ac744c68939ac111716bec0", "outputs": [ { "data": { "text/html": "
Statistics collection ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% 300/300 β€’ 0:00:28 β€’ 0:00:00\n
\n", "text/plain": "Statistics collection \u001b[38;2;114;156;31m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[35m100%\u001b[0m \u001b[38;2;0;104;181m300/300\u001b[0m β€’ \u001b[38;2;0;104;181m0:00:28\u001b[0m β€’ \u001b[38;2;0;104;181m0:00:00\u001b[0m\n" }, "metadata": {}, "output_type": "display_data" } ] } }, "cfbd848440744d58bab28a023f3cbba8": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HTMLModel", "state": { "layout": "IPY_MODEL_53e10cd7b624418eb1c6bf1eb5befeb6", "style": "IPY_MODEL_5e7b55e5bc19459f9669531ccc30fc8d", "value": "Resolving data files: 100%" } }, "d4edd971f8b34925bb49610234292feb": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HTMLModel", "state": { "layout": "IPY_MODEL_27527e0bea6049c48fda1b6c1f8dac1a", "style": "IPY_MODEL_bb5490c465384ca2bda0effdfcd363b5", "value": " 18/18 [00:00<00:00, 1816.98it/s]" } }, "e2221e3fb15646178943eaf42e7fadda": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {} }, "e448846d240a445fb1ac0613f882110b": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {} }, "e45cba8bfa8449f6aeb41539b32efe47": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {} }, "e7235f2adb4f4a8faa1e1e214ed3ed10": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HTMLStyleModel", "state": { "description_width": "", "font_size": null, "text_color": null } }, "e8ac336790a64289a3b3b3df96cd1ac1": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HTMLStyleModel", "state": { "description_width": "", "font_size": null, "text_color": null } }, "e965f9a1aa174357b8cf7a8baa20351a": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {} }, "f6e1ad982498420c83b2587e0955a319": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HBoxModel", "state": { "children": [ "IPY_MODEL_5db9284af44240a58445da7e3f84ae3a", "IPY_MODEL_7eea49c01360448ab8405a065b3e4b68", "IPY_MODEL_3025bd469e6d4d9f9254ecbb473a37cc" ], "layout": "IPY_MODEL_e2221e3fb15646178943eaf42e7fadda" } }, "f7daeee851494a9b93c7ccab59179e18": { "model_module": "@jupyter-widgets/controls", "model_module_version": "2.0.0", "model_name": "HTMLModel", "state": { "layout": "IPY_MODEL_7d96ebb96d904a079e480616f88e3842", "style": "IPY_MODEL_13d146dbc5744531aeee344d4ae49a34", "value": "Resolving data files: 100%" } }, "fbb8ab75f03a457e9911ff8620b377c6": { "model_module": "@jupyter-widgets/base", "model_module_version": "2.0.0", "model_name": "LayoutModel", "state": {} } }, "version_major": 2, "version_minor": 0 } } }, "nbformat": 4, "nbformat_minor": 4 }