Skip to content

Instantly share code, notes, and snippets.

@staghado
Created January 26, 2024 19:41
Show Gist options
  • Select an option

  • Save staghado/7a84347154c39e934b559b72a7357c14 to your computer and use it in GitHub Desktop.

Select an option

Save staghado/7a84347154c39e934b559b72a7357c14 to your computer and use it in GitHub Desktop.
Speculative_Decoding_Implementation.ipynb
Display the source blob
Display the rendered blob
Raw
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"authorship_tag": "ABX9TyOy+hqWyBcIWNgOdZvJUxsv",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"e566b2064cb6481c883ab0f0b99a68be": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_0494095f20d448638e4c7f3c28ce88a9",
"IPY_MODEL_dc1a4029436b4fd8a716fb355bafe645",
"IPY_MODEL_2f1681667a8d41a494e0dbb04a46c59b"
],
"layout": "IPY_MODEL_e3cb6d1825cb4dd6b5efc075b39a011a"
}
},
"0494095f20d448638e4c7f3c28ce88a9": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_49618eed1d5548d5b932799120a67e70",
"placeholder": "",
"style": "IPY_MODEL_b372e0776e4e41d1be9c19c708020d12",
"value": "config.json: 100%"
}
},
"dc1a4029436b4fd8a716fb355bafe645": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_2ba2b6e816d24d4c9d7a55627128a064",
"max": 665,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_591821596dac4515b00df05a17f62e83",
"value": 665
}
},
"2f1681667a8d41a494e0dbb04a46c59b": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_5694693a4de54fab90f9e259757d58ca",
"placeholder": "",
"style": "IPY_MODEL_6a0dff4b5e7840c18de01465a4a2ae2b",
"value": " 665/665 [00:00<00:00, 12.2kB/s]"
}
},
"e3cb6d1825cb4dd6b5efc075b39a011a": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"49618eed1d5548d5b932799120a67e70": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"b372e0776e4e41d1be9c19c708020d12": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"2ba2b6e816d24d4c9d7a55627128a064": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"591821596dac4515b00df05a17f62e83": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"5694693a4de54fab90f9e259757d58ca": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"6a0dff4b5e7840c18de01465a4a2ae2b": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"41a9e48d72da45cbb9cc025f5a8b33cd": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_8bfe8548f7984df29b342d87e7356712",
"IPY_MODEL_c2b9220efc70486691ee8dd52794e604",
"IPY_MODEL_1f00175b003b485a8b2f774fb860b872"
],
"layout": "IPY_MODEL_897490f08f604dc6bbd9951b604933e2"
}
},
"8bfe8548f7984df29b342d87e7356712": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_c0138fc08bd5411da0048c019f6875f4",
"placeholder": "",
"style": "IPY_MODEL_59b9ea0c2d474d8a831b207d418e75a2",
"value": "model.safetensors: 100%"
}
},
"c2b9220efc70486691ee8dd52794e604": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_fc840e761d10468fb0b6f47e5075aee0",
"max": 548105171,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_16f3a48fd5f8410f9bd9155db9726618",
"value": 548105171
}
},
"1f00175b003b485a8b2f774fb860b872": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_64e450e9c2e54699935635663c6d9c8f",
"placeholder": "",
"style": "IPY_MODEL_44f081718ed847448ce9612b316be1af",
"value": " 548M/548M [00:09<00:00, 63.5MB/s]"
}
},
"897490f08f604dc6bbd9951b604933e2": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"c0138fc08bd5411da0048c019f6875f4": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"59b9ea0c2d474d8a831b207d418e75a2": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"fc840e761d10468fb0b6f47e5075aee0": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"16f3a48fd5f8410f9bd9155db9726618": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"64e450e9c2e54699935635663c6d9c8f": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"44f081718ed847448ce9612b316be1af": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"c5b9a01676cf4b27a6de61f99b1b0df7": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_a7a082cbcefa42baae1364eca6e19620",
"IPY_MODEL_aedf24f764074b828c1c4cc8ff9e29e3",
"IPY_MODEL_389c907c03c54579ad3310d0f0dc9813"
],
"layout": "IPY_MODEL_9b9c26745394449d89c605f6ea9b12b9"
}
},
"a7a082cbcefa42baae1364eca6e19620": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_c8925c08d3e748a283122b7a5fbef738",
"placeholder": "",
"style": "IPY_MODEL_4dc96d209b204872a536b8e1a2831257",
"value": "generation_config.json: 100%"
}
},
"aedf24f764074b828c1c4cc8ff9e29e3": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_049176fa46e9494dac95d399bd51f4a1",
"max": 124,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_21a204eeeeff402b92e4c2487f341a15",
"value": 124
}
},
"389c907c03c54579ad3310d0f0dc9813": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_e13f8fbf6ce949c6af4edd7870c57daa",
"placeholder": "",
"style": "IPY_MODEL_c931707617f74d68b6aae6b69777a6cb",
"value": " 124/124 [00:00<00:00, 3.06kB/s]"
}
},
"9b9c26745394449d89c605f6ea9b12b9": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"c8925c08d3e748a283122b7a5fbef738": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"4dc96d209b204872a536b8e1a2831257": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"049176fa46e9494dac95d399bd51f4a1": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"21a204eeeeff402b92e4c2487f341a15": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"e13f8fbf6ce949c6af4edd7870c57daa": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"c931707617f74d68b6aae6b69777a6cb": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"22cb92d9ee61446ea41662df26a349f9": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_a7da08c60a9b4334940fbbc4983337b8",
"IPY_MODEL_4c721ea104614dbf83bdad78efc07132",
"IPY_MODEL_2be4699e195e481fa8e0e76857fcee00"
],
"layout": "IPY_MODEL_553f181dc057443fb878c2bb5b5c90d5"
}
},
"a7da08c60a9b4334940fbbc4983337b8": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_1cc31863ebc84cd89874f3977a28780a",
"placeholder": "",
"style": "IPY_MODEL_e6edcbe434214d1e9d18d24d89eee68d",
"value": "vocab.json: 100%"
}
},
"4c721ea104614dbf83bdad78efc07132": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_d7de685306364a2aae9bc051ac9a6121",
"max": 1042301,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_db424b5b2fba4c3998b6166f52e49451",
"value": 1042301
}
},
"2be4699e195e481fa8e0e76857fcee00": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_4bf7cb35b2e24d9dbe9ca2d622eb3f52",
"placeholder": "",
"style": "IPY_MODEL_be3d659dccbe441989defda51d6579c9",
"value": " 1.04M/1.04M [00:00<00:00, 8.05MB/s]"
}
},
"553f181dc057443fb878c2bb5b5c90d5": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"1cc31863ebc84cd89874f3977a28780a": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"e6edcbe434214d1e9d18d24d89eee68d": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"d7de685306364a2aae9bc051ac9a6121": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"db424b5b2fba4c3998b6166f52e49451": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"4bf7cb35b2e24d9dbe9ca2d622eb3f52": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"be3d659dccbe441989defda51d6579c9": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"d693aad268614da5b8a5de6bf07ead47": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_8e0050e267ad4065995c3b7dafd3c6ce",
"IPY_MODEL_e2322ce882ed4d2398e7ed421276caaf",
"IPY_MODEL_61cf8d135dfe4c2a9ecfdaec10f72c20"
],
"layout": "IPY_MODEL_9b1048db3d534b6881f79aec9157437e"
}
},
"8e0050e267ad4065995c3b7dafd3c6ce": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_13b8040a9e104732984598b84bf964ed",
"placeholder": "",
"style": "IPY_MODEL_296cfbf0a09d4cb2b7e8d0fbe93c4a2f",
"value": "merges.txt: 100%"
}
},
"e2322ce882ed4d2398e7ed421276caaf": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_c9e2dfca8373410d86bed326d9102624",
"max": 456318,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_2b608755ad7e4bbaac0110c1746f5a65",
"value": 456318
}
},
"61cf8d135dfe4c2a9ecfdaec10f72c20": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_a14de8af4de841fea33bcddb41d2b948",
"placeholder": "",
"style": "IPY_MODEL_38d0d285b99241188549c6744d0a6946",
"value": " 456k/456k [00:00<00:00, 7.37MB/s]"
}
},
"9b1048db3d534b6881f79aec9157437e": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"13b8040a9e104732984598b84bf964ed": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"296cfbf0a09d4cb2b7e8d0fbe93c4a2f": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"c9e2dfca8373410d86bed326d9102624": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"2b608755ad7e4bbaac0110c1746f5a65": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"a14de8af4de841fea33bcddb41d2b948": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"38d0d285b99241188549c6744d0a6946": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"4bbb97f89ed140ffa4f22bb773d65672": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_4fdf8ecdc3e54efe8ee85102db6efa5e",
"IPY_MODEL_facde73e2a464017bc77b9637b712639",
"IPY_MODEL_ea21fad7b64e450d94e3e93206478dde"
],
"layout": "IPY_MODEL_68a29986158e40dbb998ca4bad0a04b3"
}
},
"4fdf8ecdc3e54efe8ee85102db6efa5e": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_8d2beee2f3e0434b98d90ab8d2243df6",
"placeholder": "",
"style": "IPY_MODEL_7827e387832741678a3ce60306a44854",
"value": "tokenizer.json: 100%"
}
},
"facde73e2a464017bc77b9637b712639": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_4069e953cde5429b93351d3c755751a9",
"max": 1355256,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_88a04da262a84476bd9a8d2f2859697e",
"value": 1355256
}
},
"ea21fad7b64e450d94e3e93206478dde": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_8359175372144f9a8f7716e6bec913a7",
"placeholder": "",
"style": "IPY_MODEL_f0cac37f247e453d87adc2da037a46d3",
"value": " 1.36M/1.36M [00:00<00:00, 13.5MB/s]"
}
},
"68a29986158e40dbb998ca4bad0a04b3": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"8d2beee2f3e0434b98d90ab8d2243df6": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"7827e387832741678a3ce60306a44854": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"4069e953cde5429b93351d3c755751a9": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"88a04da262a84476bd9a8d2f2859697e": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"8359175372144f9a8f7716e6bec913a7": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"f0cac37f247e453d87adc2da037a46d3": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"bad461c49439490b9756c351e4d18db2": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_05d0463c869b4efa9a1559e725fd467c",
"IPY_MODEL_521fcf929ec843f8b238b3c5d10cac97",
"IPY_MODEL_811f6bcc25d949efa45dfe7beaa14945"
],
"layout": "IPY_MODEL_5a705303fd604026946ed60dc2ade00e"
}
},
"05d0463c869b4efa9a1559e725fd467c": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_fc4f4ab29c8244dea85fdd54e8c119a2",
"placeholder": "",
"style": "IPY_MODEL_f21dfd6165b94faea06b7471f8233ffc",
"value": "config.json: 100%"
}
},
"521fcf929ec843f8b238b3c5d10cac97": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_aa4786c581c44cab89e3dac64dbcfbac",
"max": 718,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_2056c6b0cf914e3fb67a9dd3e19926e6",
"value": 718
}
},
"811f6bcc25d949efa45dfe7beaa14945": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_4bdf2dc2d66647c59172befd7aed0da9",
"placeholder": "",
"style": "IPY_MODEL_af73ce53d28f440888083a587c783ee5",
"value": " 718/718 [00:00<00:00, 13.6kB/s]"
}
},
"5a705303fd604026946ed60dc2ade00e": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"fc4f4ab29c8244dea85fdd54e8c119a2": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"f21dfd6165b94faea06b7471f8233ffc": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"aa4786c581c44cab89e3dac64dbcfbac": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"2056c6b0cf914e3fb67a9dd3e19926e6": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"4bdf2dc2d66647c59172befd7aed0da9": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"af73ce53d28f440888083a587c783ee5": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"a598816e4e1a4eb0b5dabe6615a8f295": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_f81be231854843f295d0ba74f8dbd560",
"IPY_MODEL_a9cca300de6042b2bebce1da6ec1dff6",
"IPY_MODEL_87ec6acadc2640f881561690eefac28d"
],
"layout": "IPY_MODEL_772fcb806bbb45a4906eca40ab99a0be"
}
},
"f81be231854843f295d0ba74f8dbd560": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_994dffda864c49e79c282497b45355af",
"placeholder": "",
"style": "IPY_MODEL_c8dd0ff26cc745279c6ae3c40af35ad5",
"value": "model.safetensors: 100%"
}
},
"a9cca300de6042b2bebce1da6ec1dff6": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_7bd2ba68af5e4c5ea12646a4767daffe",
"max": 1519984962,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_280fa59988fb4cc1a2cbfd2ed3a56d42",
"value": 1519984962
}
},
"87ec6acadc2640f881561690eefac28d": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_5dcbe3a2f1f5482eac32886e02ae5047",
"placeholder": "",
"style": "IPY_MODEL_6cc0e187cba749ab9670d67dfd1f8935",
"value": " 1.52G/1.52G [00:12<00:00, 158MB/s]"
}
},
"772fcb806bbb45a4906eca40ab99a0be": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"994dffda864c49e79c282497b45355af": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"c8dd0ff26cc745279c6ae3c40af35ad5": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"7bd2ba68af5e4c5ea12646a4767daffe": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"280fa59988fb4cc1a2cbfd2ed3a56d42": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"5dcbe3a2f1f5482eac32886e02ae5047": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"6cc0e187cba749ab9670d67dfd1f8935": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"e5373e28f405433eb37b1a89ce25ae02": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_39afdb6c0b8645fc83022cb6c130cb43",
"IPY_MODEL_a71298ed2a9f41538acf7f7ff2918585",
"IPY_MODEL_83cef850010c4939b19f491236c2fbbc"
],
"layout": "IPY_MODEL_577efd1b59c4473295d1ce203d200728"
}
},
"39afdb6c0b8645fc83022cb6c130cb43": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_a0107e7bdb8445f2bb2e9de0b93158ab",
"placeholder": "",
"style": "IPY_MODEL_20e9b8766bbb442fad02c8cccaec1d7b",
"value": "generation_config.json: 100%"
}
},
"a71298ed2a9f41538acf7f7ff2918585": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_a86b3f474ed241729741ee7fa41b30b0",
"max": 124,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_6265dae978a840e09d9db048b83bbacb",
"value": 124
}
},
"83cef850010c4939b19f491236c2fbbc": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_1e55717c97ff468ca1aa976f8bbbfa9b",
"placeholder": "",
"style": "IPY_MODEL_7885c3988cd34acf9abe9dda1a2ec454",
"value": " 124/124 [00:00<00:00, 1.76kB/s]"
}
},
"577efd1b59c4473295d1ce203d200728": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"a0107e7bdb8445f2bb2e9de0b93158ab": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"20e9b8766bbb442fad02c8cccaec1d7b": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"a86b3f474ed241729741ee7fa41b30b0": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"6265dae978a840e09d9db048b83bbacb": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"1e55717c97ff468ca1aa976f8bbbfa9b": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"7885c3988cd34acf9abe9dda1a2ec454": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
}
}
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/gist/staghado/7a84347154c39e934b559b72a7357c14/speculative_decoding_implementation.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "markdown",
"source": [
"# Speculative Decoding"
],
"metadata": {
"id": "niLCFiiLOfNq"
}
},
{
"cell_type": "markdown",
"source": [
"The objective of this Notebook is to implement the Speculative Decoding algorithm from the **[paper](https://arxiv.org/pdf/2211.17192.pdf)** : Fast Inference from Transformers via Speculative Decoding."
],
"metadata": {
"id": "ixTaO5N7N87_"
}
},
{
"cell_type": "markdown",
"source": [
"Speculative Decoding works by considering two models $M_p$ and $M_q$ where $M_p$ represents the target model(slow or expensive to evaluate) and $M_q$ is a more efficient model for the same task(what would happen if it's not the same task?). The conditional probability $p(x_t|x_{<t}) = p(x)$ is what we get when we run a prefix/context $x_{<t}$ through the model $M_p$. We have the same thing for q.\n",
"\n",
"\n",
"The algorithm is divided into three steps:\n",
"\n",
"\n",
"1. Use $M_q$ to autoregressively generate $\\gamma$ guesses\n",
"2. Use $M_p$ to evaluate all the guesses and their probabilities in *parallel* and accept those that give the same distribution\n",
"3. Sample an additional token from an adjusted distribution to fix the first rejected token or to add an additional one if they are all accepeted\n",
"\n",
"Each time the target model is run in parallel, a token is either accepted or generated thus even in the worst case(all completions generated by $M_q$ are rejected), the number of serial runs of the target model can not be larger than that of the simple autoregressive method. But it can generate up to $\\gamma + 1$ new tokens depending on how well is $M_q$ an approximaton of $M_p$. This means that choosing $\\gamma$ is crucial.\n",
"\n",
"## Speculative Sampling\n",
"\n",
"To sample a token $x$ from $p(x)$, we sample $x$ from $q(x)$. If the acceptance rate $r = \\frac{p(x)}{q(x)}$ is bigger than 1 we accept $x$ else we reject it with a probability equal to $1 - r$ and sample x again from an adjusted distribution defined as $p'(x) = norm(max(0, p(x) - q(x))) = \\frac{p(x)-min(q(x), p(x))}{\\sum_{x'}p(x')-min(q(x'), p(x'))}$.\n",
"\n",
"This ensures that each sample $x$ is indeed from $p(x)$."
],
"metadata": {
"id": "1HOc2aoCTsLv"
}
},
{
"cell_type": "markdown",
"source": [
"I am going to implement this algorithm in Python and illustrate its effectiveness using the GPT2 model."
],
"metadata": {
"id": "4ZM0xneAjKOZ"
}
},
{
"cell_type": "markdown",
"source": [
"# Implementation"
],
"metadata": {
"id": "xHy4pafXbBOH"
}
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "_mEYCDseD4WD",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 429,
"referenced_widgets": [
"e566b2064cb6481c883ab0f0b99a68be",
"0494095f20d448638e4c7f3c28ce88a9",
"dc1a4029436b4fd8a716fb355bafe645",
"2f1681667a8d41a494e0dbb04a46c59b",
"e3cb6d1825cb4dd6b5efc075b39a011a",
"49618eed1d5548d5b932799120a67e70",
"b372e0776e4e41d1be9c19c708020d12",
"2ba2b6e816d24d4c9d7a55627128a064",
"591821596dac4515b00df05a17f62e83",
"5694693a4de54fab90f9e259757d58ca",
"6a0dff4b5e7840c18de01465a4a2ae2b",
"41a9e48d72da45cbb9cc025f5a8b33cd",
"8bfe8548f7984df29b342d87e7356712",
"c2b9220efc70486691ee8dd52794e604",
"1f00175b003b485a8b2f774fb860b872",
"897490f08f604dc6bbd9951b604933e2",
"c0138fc08bd5411da0048c019f6875f4",
"59b9ea0c2d474d8a831b207d418e75a2",
"fc840e761d10468fb0b6f47e5075aee0",
"16f3a48fd5f8410f9bd9155db9726618",
"64e450e9c2e54699935635663c6d9c8f",
"44f081718ed847448ce9612b316be1af",
"c5b9a01676cf4b27a6de61f99b1b0df7",
"a7a082cbcefa42baae1364eca6e19620",
"aedf24f764074b828c1c4cc8ff9e29e3",
"389c907c03c54579ad3310d0f0dc9813",
"9b9c26745394449d89c605f6ea9b12b9",
"c8925c08d3e748a283122b7a5fbef738",
"4dc96d209b204872a536b8e1a2831257",
"049176fa46e9494dac95d399bd51f4a1",
"21a204eeeeff402b92e4c2487f341a15",
"e13f8fbf6ce949c6af4edd7870c57daa",
"c931707617f74d68b6aae6b69777a6cb",
"22cb92d9ee61446ea41662df26a349f9",
"a7da08c60a9b4334940fbbc4983337b8",
"4c721ea104614dbf83bdad78efc07132",
"2be4699e195e481fa8e0e76857fcee00",
"553f181dc057443fb878c2bb5b5c90d5",
"1cc31863ebc84cd89874f3977a28780a",
"e6edcbe434214d1e9d18d24d89eee68d",
"d7de685306364a2aae9bc051ac9a6121",
"db424b5b2fba4c3998b6166f52e49451",
"4bf7cb35b2e24d9dbe9ca2d622eb3f52",
"be3d659dccbe441989defda51d6579c9",
"d693aad268614da5b8a5de6bf07ead47",
"8e0050e267ad4065995c3b7dafd3c6ce",
"e2322ce882ed4d2398e7ed421276caaf",
"61cf8d135dfe4c2a9ecfdaec10f72c20",
"9b1048db3d534b6881f79aec9157437e",
"13b8040a9e104732984598b84bf964ed",
"296cfbf0a09d4cb2b7e8d0fbe93c4a2f",
"c9e2dfca8373410d86bed326d9102624",
"2b608755ad7e4bbaac0110c1746f5a65",
"a14de8af4de841fea33bcddb41d2b948",
"38d0d285b99241188549c6744d0a6946",
"4bbb97f89ed140ffa4f22bb773d65672",
"4fdf8ecdc3e54efe8ee85102db6efa5e",
"facde73e2a464017bc77b9637b712639",
"ea21fad7b64e450d94e3e93206478dde",
"68a29986158e40dbb998ca4bad0a04b3",
"8d2beee2f3e0434b98d90ab8d2243df6",
"7827e387832741678a3ce60306a44854",
"4069e953cde5429b93351d3c755751a9",
"88a04da262a84476bd9a8d2f2859697e",
"8359175372144f9a8f7716e6bec913a7",
"f0cac37f247e453d87adc2da037a46d3",
"bad461c49439490b9756c351e4d18db2",
"05d0463c869b4efa9a1559e725fd467c",
"521fcf929ec843f8b238b3c5d10cac97",
"811f6bcc25d949efa45dfe7beaa14945",
"5a705303fd604026946ed60dc2ade00e",
"fc4f4ab29c8244dea85fdd54e8c119a2",
"f21dfd6165b94faea06b7471f8233ffc",
"aa4786c581c44cab89e3dac64dbcfbac",
"2056c6b0cf914e3fb67a9dd3e19926e6",
"4bdf2dc2d66647c59172befd7aed0da9",
"af73ce53d28f440888083a587c783ee5",
"a598816e4e1a4eb0b5dabe6615a8f295",
"f81be231854843f295d0ba74f8dbd560",
"a9cca300de6042b2bebce1da6ec1dff6",
"87ec6acadc2640f881561690eefac28d",
"772fcb806bbb45a4906eca40ab99a0be",
"994dffda864c49e79c282497b45355af",
"c8dd0ff26cc745279c6ae3c40af35ad5",
"7bd2ba68af5e4c5ea12646a4767daffe",
"280fa59988fb4cc1a2cbfd2ed3a56d42",
"5dcbe3a2f1f5482eac32886e02ae5047",
"6cc0e187cba749ab9670d67dfd1f8935",
"e5373e28f405433eb37b1a89ce25ae02",
"39afdb6c0b8645fc83022cb6c130cb43",
"a71298ed2a9f41538acf7f7ff2918585",
"83cef850010c4939b19f491236c2fbbc",
"577efd1b59c4473295d1ce203d200728",
"a0107e7bdb8445f2bb2e9de0b93158ab",
"20e9b8766bbb442fad02c8cccaec1d7b",
"a86b3f474ed241729741ee7fa41b30b0",
"6265dae978a840e09d9db048b83bbacb",
"1e55717c97ff468ca1aa976f8bbbfa9b",
"7885c3988cd34acf9abe9dda1a2ec454"
]
},
"outputId": "074c0353-e7eb-42c3-94b1-685c843dfb16"
},
"outputs": [
{
"output_type": "stream",
"name": "stderr",
"text": [
"/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_token.py:88: UserWarning: \n",
"The secret `HF_TOKEN` does not exist in your Colab secrets.\n",
"To authenticate with the Hugging Face Hub, create a token in your settings tab (https://huggingface.co/settings/tokens), set it as secret in your Google Colab and restart your session.\n",
"You will be able to reuse this secret in all of your notebooks.\n",
"Please note that authentication is recommended but still optional to access public models or datasets.\n",
" warnings.warn(\n"
]
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"config.json: 0%| | 0.00/665 [00:00<?, ?B/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "e566b2064cb6481c883ab0f0b99a68be"
}
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"model.safetensors: 0%| | 0.00/548M [00:00<?, ?B/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "41a9e48d72da45cbb9cc025f5a8b33cd"
}
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"generation_config.json: 0%| | 0.00/124 [00:00<?, ?B/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "c5b9a01676cf4b27a6de61f99b1b0df7"
}
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"vocab.json: 0%| | 0.00/1.04M [00:00<?, ?B/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "22cb92d9ee61446ea41662df26a349f9"
}
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"merges.txt: 0%| | 0.00/456k [00:00<?, ?B/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "d693aad268614da5b8a5de6bf07ead47"
}
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"tokenizer.json: 0%| | 0.00/1.36M [00:00<?, ?B/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "4bbb97f89ed140ffa4f22bb773d65672"
}
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"config.json: 0%| | 0.00/718 [00:00<?, ?B/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "bad461c49439490b9756c351e4d18db2"
}
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"model.safetensors: 0%| | 0.00/1.52G [00:00<?, ?B/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "a598816e4e1a4eb0b5dabe6615a8f295"
}
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"generation_config.json: 0%| | 0.00/124 [00:00<?, ?B/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "e5373e28f405433eb37b1a89ce25ae02"
}
},
"metadata": {}
}
],
"source": [
"import torch\n",
"import torch.nn.functional as F\n",
"import numpy as np\n",
"from transformers import GPT2LMHeadModel, GPT2Tokenizer\n",
"\n",
"\n",
"device = torch.device(\"cuda\" if torch.cuda.is_available() else \"cpu\")\n",
"\n",
"# Load model and tokenizer\n",
"small_model = GPT2LMHeadModel.from_pretrained('gpt2')\n",
"tokenizer = GPT2Tokenizer.from_pretrained('gpt2')\n",
"small_model.eval()\n",
"\n",
"big_model = GPT2LMHeadModel.from_pretrained('gpt2-medium')\n",
"# tokenizer = GPT2Tokenizer.from_pretrained('gpt2-base')\n",
"big_model.eval();"
]
},
{
"cell_type": "code",
"source": [
"def normalize_probability(p, q):\n",
" # calculate max(0, p - q)\n",
" max_p_q = np.maximum(0, p - q)\n",
"\n",
" # sum of max(0, p - q)\n",
" sum_max_p_q = np.sum(max_p_q)\n",
"\n",
" return max_p_q / sum_max_p_q\n",
"\n",
"@torch.inference_mode()\n",
"def speculative_decoding(big_model, small_model, tokenizer, context, gamma, max_len, device='cpu'):\n",
" big_model.to(device)\n",
" small_model.to(device)\n",
"\n",
" # Prepare for generation\n",
" input_ids = tokenizer.encode(context, return_tensors='pt').to(device)\n",
" output_tokens = input_ids.squeeze(0).tolist()\n",
" print(f\"prefix : {output_tokens}\")\n",
" seq_len = len(output_tokens)\n",
" T = seq_len + max_len\n",
"\n",
" while len(output_tokens) < T:\n",
" print(\"\\n\")\n",
" input_ids = torch.tensor(output_tokens, device=device).unsqueeze(0)\n",
" print(input_ids)\n",
"\n",
" # Autoregressive prediction using the small model\n",
" qs = []\n",
" for _ in range(gamma):\n",
" # Keep only the last gamma tokens\n",
" if input_ids.size(1) > gamma:\n",
" current_input_ids = input_ids[:, -gamma:]\n",
" else:\n",
" current_input_ids = input_ids\n",
"\n",
" logits = small_model(current_input_ids).logits\n",
" q = F.softmax(logits, dim=-1)\n",
" token_id = torch.argmax(q[:, -1, :], dim=1)\n",
" qs.append(q[torch.arange(q.size(0)), -1, token_id].item())\n",
"\n",
" input_ids = torch.cat([input_ids, token_id.unsqueeze(-1)], dim=1)\n",
"\n",
" #print(input_ids)\n",
" print(f\"qs : {qs}\")\n",
" #print(f\"q : {q.shape}\")\n",
"\n",
" # Parallel prediction using the big model for all gamma tokens\n",
" sequences = []\n",
" for i in range(0, gamma):\n",
" flattened_slice = input_ids[0, :seq_len+i+1].tolist()\n",
" sequence = [tokenizer.eos_token_id] * (gamma + 1 - i) + flattened_slice\n",
" sequences.append(sequence)\n",
"\n",
" big_model_input_ids = torch.tensor(sequences, device=device)\n",
" #print(f\"sequences : \\n {big_model_input_ids}\")\n",
" logits = big_model(big_model_input_ids).logits\n",
" p = F.softmax(logits, dim=-1)\n",
" max_indices = torch.argmax(p[:, -1, :], dim=1)\n",
" ps = p[torch.arange(p.size(0)), -1, max_indices].tolist()\n",
"\n",
" print(f\"ps : {ps}\")\n",
" #print(f\"p : {p.shape}\")\n",
"\n",
" # Rejection sampling (is this the term?)\n",
" for i in range(gamma):\n",
" r = np.random.rand()\n",
" if r < min(1, ps[i] / qs[i]):\n",
" print(f\"Accept token --- {r=}\")\n",
" output_tokens.append(input_ids[0, i].item())\n",
" else:\n",
" print(f\"Reject token --- {r=}\")\n",
" # Resample from modified distribution (p - q)+\n",
" p_values = p[i, -1].cpu().numpy() # Mp(x|prefix + [x1, ..., xi])\n",
" q_values = q[0, i].cpu().numpy() # Mq(x|prefix + [x1, ..., xi])\n",
" modified_dist = normalize_probability(p_values, q_values)\n",
" resampled_token = np.argmax(modified_dist)\n",
" output_tokens.append(resampled_token)\n",
" break\n",
"\n",
" if len(output_tokens) >= T:\n",
" break\n",
"\n",
" return tokenizer.decode(output_tokens)"
],
"metadata": {
"id": "EIivAKNxwUcf"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"speculative_decoding(big_model, small_model, tokenizer, context=\"?\", gamma=10, max_len=20, device='cpu')"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000
},
"id": "Gt8oCZarwWm7",
"outputId": "27767a5e-bcbe-4406-d7be-f7c406a2f228"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"prefix : [30]\n",
"\n",
"\n",
"tensor([[30]])\n",
"qs : [0.19046689569950104, 0.9974822402000427, 0.04046527296304703, 0.014151415787637234, 0.17853666841983795, 0.24155157804489136, 0.1434582620859146, 0.35640135407447815, 0.46105727553367615, 0.2116636484861374]\n",
"ps : [0.9997956156730652, 0.04178453981876373, 0.009618090465664864, 0.07049383968114853, 0.28149107098579407, 0.12991298735141754, 0.3220902383327484, 0.31611168384552, 0.21645575761795044, 0.005884469486773014]\n",
"Accept token --- r=0.7949574078488768\n",
"Reject token --- r=0.9867005161530952\n",
"\n",
"\n",
"tensor([[ 30, 30, 464]])\n",
"qs : [0.017411954700946808, 0.5770674347877502, 0.15108421444892883, 0.3730606436729431, 0.190965935587883, 0.13193561136722565, 0.3160296678543091, 0.27728918194770813, 0.07303090393543243, 0.06415461748838425]\n",
"ps : [0.12164535373449326, 0.00834901537746191, 0.4111337661743164, 0.2350817173719406, 0.4014590084552765, 0.19441832602024078, 0.17333969473838806, 0.37568894028663635, 0.4460189640522003, 0.08329732716083527]\n",
"Accept token --- r=0.9124535407715543\n",
"Reject token --- r=0.1485821175199964\n",
"\n",
"\n",
"tensor([[ 30, 30, 464, 30, 471]])\n",
"qs : [0.09757586568593979, 0.3589145243167877, 0.08827701210975647, 0.16411790251731873, 0.1429288387298584, 0.34841737151145935, 0.24378572404384613, 0.23079589009284973, 0.3766885995864868, 0.3927386403083801]\n",
"ps : [0.12164535373449326, 0.00834901537746191, 0.03454000502824783, 0.490310937166214, 0.3080926239490509, 0.12946657836437225, 0.14953801035881042, 0.11066985875368118, 0.324092298746109, 0.274862676858902]\n",
"Accept token --- r=0.2584475772707704\n",
"Reject token --- r=0.4002190391692598\n",
"\n",
"\n",
"tensor([[ 30, 30, 464, 30, 471, 30, 471]])\n",
"qs : [0.23126403987407684, 0.20943371951580048, 0.6963736414909363, 0.3198361098766327, 0.8611474633216858, 0.7109270691871643, 0.918040931224823, 0.7878872752189636, 0.918040931224823, 0.7878872752189636]\n",
"ps : [0.12164535373449326, 0.00834901537746191, 0.03454000502824783, 0.490310937166214, 0.0907512679696083, 0.3403111398220062, 0.04369279369711876, 0.601730227470398, 0.1389172524213791, 0.7183928489685059]\n",
"Reject token --- r=0.5812715698616406\n",
"\n",
"\n",
"tensor([[ 30, 30, 464, 30, 471, 30, 471, 198]])\n",
"qs : [0.9983175992965698, 0.039442963898181915, 0.08644590526819229, 0.2016361951828003, 0.33566009998321533, 0.999723494052887, 0.12391902506351471, 0.3279598355293274, 0.8937756419181824, 0.5827931761741638]\n",
"ps : [0.12164535373449326, 0.00834901537746191, 0.03454000502824783, 0.490310937166214, 0.0907512679696083, 0.3403111398220062, 0.9992044568061829, 0.17599572241306305, 0.09412114322185516, 0.3690154552459717]\n",
"Reject token --- r=0.33250058623219925\n",
"\n",
"\n",
"tensor([[ 30, 30, 464, 30, 471, 30, 471, 198, 317]])\n",
"qs : [0.07126375287771225, 0.16335107386112213, 0.17992806434631348, 0.96848464012146, 0.139245867729187, 0.16008779406547546, 0.9997510313987732, 0.4954289495944977, 0.7942255139350891, 0.9997485280036926]\n",
"ps : [0.12164535373449326, 0.00834901537746191, 0.03454000502824783, 0.490310937166214, 0.0907512679696083, 0.3403111398220062, 0.9992044568061829, 0.2770899832248688, 0.12410762161016464, 0.2301088571548462]\n",
"Accept token --- r=0.8550008414400189\n",
"Reject token --- r=0.4859357257031437\n",
"\n",
"\n",
"tensor([[ 30, 30, 464, 30, 471, 30, 471, 198, 317, 30, 717]])\n",
"qs : [0.06684976816177368, 0.08340673893690109, 0.09082558751106262, 0.2181549370288849, 0.24584779143333435, 0.13503772020339966, 0.12941280007362366, 0.11891001462936401, 0.2181248664855957, 0.5539020895957947]\n",
"ps : [0.12164535373449326, 0.00834901537746191, 0.03454000502824783, 0.490310937166214, 0.0907512679696083, 0.3403111398220062, 0.9992044568061829, 0.2770899832248688, 0.12410762161016464, 0.039666011929512024]\n",
"Accept token --- r=0.2566709926371308\n",
"Reject token --- r=0.2608691919724604\n",
"\n",
"\n",
"tensor([[ 30, 30, 464, 30, 471, 30, 471, 198, 317, 30, 717, 30, 471]])\n",
"qs : [0.1881367415189743, 0.9962267875671387, 0.09159476310014725, 0.32305991649627686, 0.9997047781944275, 0.6163424253463745, 0.8433228135108948, 0.9997914433479309, 0.8690729737281799, 0.924921989440918]\n",
"ps : [0.12164535373449326, 0.00834901537746191, 0.03454000502824783, 0.490310937166214, 0.0907512679696083, 0.3403111398220062, 0.9992044568061829, 0.2770899832248688, 0.12410762161016464, 0.039666011929512024]\n",
"Reject token --- r=0.8588050024973333\n",
"\n",
"\n",
"tensor([[ 30, 30, 464, 30, 471, 30, 471, 198, 317, 30, 717, 30, 471, 198]])\n",
"qs : [0.9962267875671387, 0.09159476310014725, 0.32305991649627686, 0.9997047781944275, 0.6163424253463745, 0.8433228135108948, 0.9997914433479309, 0.8690729737281799, 0.924921989440918, 0.9997794032096863]\n",
"ps : [0.12164535373449326, 0.00834901537746191, 0.03454000502824783, 0.490310937166214, 0.0907512679696083, 0.3403111398220062, 0.9992044568061829, 0.2770899832248688, 0.12410762161016464, 0.039666011929512024]\n",
"Accept token --- r=0.015186309015798094\n",
"Reject token --- r=0.5741618338963972\n",
"\n",
"\n",
"tensor([[ 30, 30, 464, 30, 471, 30, 471, 198, 317, 30, 717, 30, 471, 198,\n",
" 30, 471]])\n",
"qs : [0.3230714797973633, 0.9677258729934692, 0.13142770528793335, 0.5596310496330261, 0.6324248909950256, 0.9996699094772339, 0.7634159922599792, 0.9043468236923218, 0.8917067050933838, 0.9997115731239319]\n",
"ps : [0.12164535373449326, 0.00834901537746191, 0.03454000502824783, 0.490310937166214, 0.0907512679696083, 0.3403111398220062, 0.9992044568061829, 0.2770899832248688, 0.12410762161016464, 0.039666011929512024]\n",
"Reject token --- r=0.5911273052527936\n",
"\n",
"\n",
"tensor([[ 30, 30, 464, 30, 471, 30, 471, 198, 317, 30, 717, 30, 471, 198,\n",
" 30, 471, 198]])\n",
"qs : [0.9677258729934692, 0.13142770528793335, 0.5596310496330261, 0.6324248909950256, 0.9996699094772339, 0.7634159922599792, 0.9043468236923218, 0.8917067050933838, 0.9997115731239319, 0.8051623702049255]\n",
"ps : [0.12164535373449326, 0.00834901537746191, 0.03454000502824783, 0.490310937166214, 0.0907512679696083, 0.3403111398220062, 0.9992044568061829, 0.2770899832248688, 0.12410762161016464, 0.039666011929512024]\n",
"Accept token --- r=0.11129868971047663\n",
"Reject token --- r=0.3525345294785772\n",
"\n",
"\n",
"tensor([[ 30, 30, 464, 30, 471, 30, 471, 198, 317, 30, 717, 30, 471, 198,\n",
" 30, 471, 198, 30, 471]])\n",
"qs : [0.6963173747062683, 0.831706702709198, 0.7058556079864502, 0.8536752462387085, 0.8859078288078308, 0.9996699094772339, 0.7634159922599792, 0.9043468236923218, 0.8917067050933838, 0.9997115731239319]\n",
"ps : [0.12164535373449326, 0.00834901537746191, 0.03454000502824783, 0.490310937166214, 0.0907512679696083, 0.3403111398220062, 0.9992044568061829, 0.2770899832248688, 0.12410762161016464, 0.039666011929512024]\n",
"Reject token --- r=0.6918611788359988\n",
"\n",
"\n",
"tensor([[ 30, 30, 464, 30, 471, 30, 471, 198, 317, 30, 717, 30, 471, 198,\n",
" 30, 471, 198, 30, 471, 198]])\n",
"qs : [0.831706702709198, 0.7058556079864502, 0.8536752462387085, 0.8859078288078308, 0.9996699094772339, 0.7634159922599792, 0.9043468236923218, 0.8917067050933838, 0.9997115731239319, 0.8051623702049255]\n",
"ps : [0.12164535373449326, 0.00834901537746191, 0.03454000502824783, 0.490310937166214, 0.0907512679696083, 0.3403111398220062, 0.9992044568061829, 0.2770899832248688, 0.12410762161016464, 0.039666011929512024]\n",
"Reject token --- r=0.7882347905816853\n"
]
},
{
"output_type": "execute_result",
"data": {
"text/plain": [
"'??The? U? U\\n A? first? U\\n? U\\n? U\\n A'"
],
"application/vnd.google.colaboratory.intrinsic+json": {
"type": "string"
}
},
"metadata": {},
"execution_count": 119
}
]
},
{
"cell_type": "markdown",
"source": [
"We can see that there is a problem of repetition which is due to the argmax sapmling(greedy decoding). We can use other sampling methods like beam search, topk, topp(nucleus), etc"
],
"metadata": {
"id": "DOqcUDzX-4_I"
}
},
{
"cell_type": "code",
"source": [],
"metadata": {
"id": "gEKtOMdy-sVd"
},
"execution_count": null,
"outputs": []
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment