├── Code_Generation.ipynb └── README.md /Code_Generation.ipynb: -------------------------------------------------------------------------------- 1 | { 2 | "nbformat": 4, 3 | "nbformat_minor": 0, 4 | "metadata": { 5 | "colab": { 6 | "provenance": [], 7 | "gpuType": "T4" 8 | }, 9 | "kernelspec": { 10 | "name": "python3", 11 | "display_name": "Python 3" 12 | }, 13 | "language_info": { 14 | "name": "python" 15 | }, 16 | "accelerator": "GPU", 17 | "widgets": { 18 | "application/vnd.jupyter.widget-state+json": { 19 | "bcba83c8879042418a9394f9c7f81679": { 20 | "model_module": "@jupyter-widgets/controls", 21 | "model_name": "HBoxModel", 22 | "model_module_version": "1.5.0", 23 | "state": { 24 | "_dom_classes": [], 25 | "_model_module": "@jupyter-widgets/controls", 26 | "_model_module_version": "1.5.0", 27 | "_model_name": "HBoxModel", 28 | "_view_count": null, 29 | "_view_module": "@jupyter-widgets/controls", 30 | "_view_module_version": "1.5.0", 31 | "_view_name": "HBoxView", 32 | "box_style": "", 33 | "children": [ 34 | "IPY_MODEL_a8800aed719f4c8984347d345c790494", 35 | "IPY_MODEL_082b115d8c2942668f895730b48afe13", 36 | "IPY_MODEL_1931804d191c4e68b437313911d62d62" 37 | ], 38 | "layout": "IPY_MODEL_da117453b266461f9cdd0a7e37ecee23" 39 | } 40 | }, 41 | "a8800aed719f4c8984347d345c790494": { 42 | "model_module": "@jupyter-widgets/controls", 43 | "model_name": "HTMLModel", 44 | "model_module_version": "1.5.0", 45 | "state": { 46 | "_dom_classes": [], 47 | "_model_module": "@jupyter-widgets/controls", 48 | "_model_module_version": "1.5.0", 49 | "_model_name": "HTMLModel", 50 | "_view_count": null, 51 | "_view_module": "@jupyter-widgets/controls", 52 | "_view_module_version": "1.5.0", 53 | "_view_name": "HTMLView", 54 | "description": "", 55 | "description_tooltip": null, 56 | "layout": "IPY_MODEL_bc2e808c538e4b3790a020c334160753", 57 | "placeholder": "​", 58 | "style": "IPY_MODEL_1a454f10f9384fcc8b6be65ae431f952", 59 | "value": "Loading checkpoint shards: 100%" 60 | } 61 | }, 62 | "082b115d8c2942668f895730b48afe13": { 63 | "model_module": "@jupyter-widgets/controls", 64 | "model_name": "FloatProgressModel", 65 | "model_module_version": "1.5.0", 66 | "state": { 67 | "_dom_classes": [], 68 | "_model_module": "@jupyter-widgets/controls", 69 | "_model_module_version": "1.5.0", 70 | "_model_name": "FloatProgressModel", 71 | "_view_count": null, 72 | "_view_module": "@jupyter-widgets/controls", 73 | "_view_module_version": "1.5.0", 74 | "_view_name": "ProgressView", 75 | "bar_style": "success", 76 | "description": "", 77 | "description_tooltip": null, 78 | "layout": "IPY_MODEL_77060e0cee3c468f8f9ef3dd4b3fa2cc", 79 | "max": 2, 80 | "min": 0, 81 | "orientation": "horizontal", 82 | "style": "IPY_MODEL_ae787850f79f4668818b38aea2296112", 83 | "value": 2 84 | } 85 | }, 86 | "1931804d191c4e68b437313911d62d62": { 87 | "model_module": "@jupyter-widgets/controls", 88 | "model_name": "HTMLModel", 89 | "model_module_version": "1.5.0", 90 | "state": { 91 | "_dom_classes": [], 92 | "_model_module": "@jupyter-widgets/controls", 93 | "_model_module_version": "1.5.0", 94 | "_model_name": "HTMLModel", 95 | "_view_count": null, 96 | "_view_module": "@jupyter-widgets/controls", 97 | "_view_module_version": "1.5.0", 98 | "_view_name": "HTMLView", 99 | "description": "", 100 | "description_tooltip": null, 101 | "layout": "IPY_MODEL_6722d10d7c7144f3aa16140e10ce9ad3", 102 | "placeholder": "​", 103 | "style": "IPY_MODEL_e9de96c18d0e45e5b32ce0d90043ce42", 104 | "value": " 2/2 [01:04<00:00, 29.59s/it]" 105 | } 106 | }, 107 | "da117453b266461f9cdd0a7e37ecee23": { 108 | "model_module": "@jupyter-widgets/base", 109 | "model_name": "LayoutModel", 110 | "model_module_version": "1.2.0", 111 | "state": { 112 | "_model_module": "@jupyter-widgets/base", 113 | "_model_module_version": "1.2.0", 114 | "_model_name": "LayoutModel", 115 | "_view_count": null, 116 | "_view_module": "@jupyter-widgets/base", 117 | "_view_module_version": "1.2.0", 118 | "_view_name": "LayoutView", 119 | "align_content": null, 120 | "align_items": null, 121 | "align_self": null, 122 | "border": null, 123 | "bottom": null, 124 | "display": null, 125 | "flex": null, 126 | "flex_flow": null, 127 | "grid_area": null, 128 | "grid_auto_columns": null, 129 | "grid_auto_flow": null, 130 | "grid_auto_rows": null, 131 | "grid_column": null, 132 | "grid_gap": null, 133 | "grid_row": null, 134 | "grid_template_areas": null, 135 | "grid_template_columns": null, 136 | "grid_template_rows": null, 137 | "height": null, 138 | "justify_content": null, 139 | "justify_items": null, 140 | "left": null, 141 | "margin": null, 142 | "max_height": null, 143 | "max_width": null, 144 | "min_height": null, 145 | "min_width": null, 146 | "object_fit": null, 147 | "object_position": null, 148 | "order": null, 149 | "overflow": null, 150 | "overflow_x": null, 151 | "overflow_y": null, 152 | "padding": null, 153 | "right": null, 154 | "top": null, 155 | "visibility": null, 156 | "width": null 157 | } 158 | }, 159 | "bc2e808c538e4b3790a020c334160753": { 160 | "model_module": "@jupyter-widgets/base", 161 | "model_name": "LayoutModel", 162 | "model_module_version": "1.2.0", 163 | "state": { 164 | "_model_module": "@jupyter-widgets/base", 165 | "_model_module_version": "1.2.0", 166 | "_model_name": "LayoutModel", 167 | "_view_count": null, 168 | "_view_module": "@jupyter-widgets/base", 169 | "_view_module_version": "1.2.0", 170 | "_view_name": "LayoutView", 171 | "align_content": null, 172 | "align_items": null, 173 | "align_self": null, 174 | "border": null, 175 | "bottom": null, 176 | "display": null, 177 | "flex": null, 178 | "flex_flow": null, 179 | "grid_area": null, 180 | "grid_auto_columns": null, 181 | "grid_auto_flow": null, 182 | "grid_auto_rows": null, 183 | "grid_column": null, 184 | "grid_gap": null, 185 | "grid_row": null, 186 | "grid_template_areas": null, 187 | "grid_template_columns": null, 188 | "grid_template_rows": null, 189 | "height": null, 190 | "justify_content": null, 191 | "justify_items": null, 192 | "left": null, 193 | "margin": null, 194 | "max_height": null, 195 | "max_width": null, 196 | "min_height": null, 197 | "min_width": null, 198 | "object_fit": null, 199 | "object_position": null, 200 | "order": null, 201 | "overflow": null, 202 | "overflow_x": null, 203 | "overflow_y": null, 204 | "padding": null, 205 | "right": null, 206 | "top": null, 207 | "visibility": null, 208 | "width": null 209 | } 210 | }, 211 | "1a454f10f9384fcc8b6be65ae431f952": { 212 | "model_module": "@jupyter-widgets/controls", 213 | "model_name": "DescriptionStyleModel", 214 | "model_module_version": "1.5.0", 215 | "state": { 216 | "_model_module": "@jupyter-widgets/controls", 217 | "_model_module_version": "1.5.0", 218 | "_model_name": "DescriptionStyleModel", 219 | "_view_count": null, 220 | "_view_module": "@jupyter-widgets/base", 221 | "_view_module_version": "1.2.0", 222 | "_view_name": "StyleView", 223 | "description_width": "" 224 | } 225 | }, 226 | "77060e0cee3c468f8f9ef3dd4b3fa2cc": { 227 | "model_module": "@jupyter-widgets/base", 228 | "model_name": "LayoutModel", 229 | "model_module_version": "1.2.0", 230 | "state": { 231 | "_model_module": "@jupyter-widgets/base", 232 | "_model_module_version": "1.2.0", 233 | "_model_name": "LayoutModel", 234 | "_view_count": null, 235 | "_view_module": "@jupyter-widgets/base", 236 | "_view_module_version": "1.2.0", 237 | "_view_name": "LayoutView", 238 | "align_content": null, 239 | "align_items": null, 240 | "align_self": null, 241 | "border": null, 242 | "bottom": null, 243 | "display": null, 244 | "flex": null, 245 | "flex_flow": null, 246 | "grid_area": null, 247 | "grid_auto_columns": null, 248 | "grid_auto_flow": null, 249 | "grid_auto_rows": null, 250 | "grid_column": null, 251 | "grid_gap": null, 252 | "grid_row": null, 253 | "grid_template_areas": null, 254 | "grid_template_columns": null, 255 | "grid_template_rows": null, 256 | "height": null, 257 | "justify_content": null, 258 | "justify_items": null, 259 | "left": null, 260 | "margin": null, 261 | "max_height": null, 262 | "max_width": null, 263 | "min_height": null, 264 | "min_width": null, 265 | "object_fit": null, 266 | "object_position": null, 267 | "order": null, 268 | "overflow": null, 269 | "overflow_x": null, 270 | "overflow_y": null, 271 | "padding": null, 272 | "right": null, 273 | "top": null, 274 | "visibility": null, 275 | "width": null 276 | } 277 | }, 278 | "ae787850f79f4668818b38aea2296112": { 279 | "model_module": "@jupyter-widgets/controls", 280 | "model_name": "ProgressStyleModel", 281 | "model_module_version": "1.5.0", 282 | "state": { 283 | "_model_module": "@jupyter-widgets/controls", 284 | "_model_module_version": "1.5.0", 285 | "_model_name": "ProgressStyleModel", 286 | "_view_count": null, 287 | "_view_module": "@jupyter-widgets/base", 288 | "_view_module_version": "1.2.0", 289 | "_view_name": "StyleView", 290 | "bar_color": null, 291 | "description_width": "" 292 | } 293 | }, 294 | "6722d10d7c7144f3aa16140e10ce9ad3": { 295 | "model_module": "@jupyter-widgets/base", 296 | "model_name": "LayoutModel", 297 | "model_module_version": "1.2.0", 298 | "state": { 299 | "_model_module": "@jupyter-widgets/base", 300 | "_model_module_version": "1.2.0", 301 | "_model_name": "LayoutModel", 302 | "_view_count": null, 303 | "_view_module": "@jupyter-widgets/base", 304 | "_view_module_version": "1.2.0", 305 | "_view_name": "LayoutView", 306 | "align_content": null, 307 | "align_items": null, 308 | "align_self": null, 309 | "border": null, 310 | "bottom": null, 311 | "display": null, 312 | "flex": null, 313 | "flex_flow": null, 314 | "grid_area": null, 315 | "grid_auto_columns": null, 316 | "grid_auto_flow": null, 317 | "grid_auto_rows": null, 318 | "grid_column": null, 319 | "grid_gap": null, 320 | "grid_row": null, 321 | "grid_template_areas": null, 322 | "grid_template_columns": null, 323 | "grid_template_rows": null, 324 | "height": null, 325 | "justify_content": null, 326 | "justify_items": null, 327 | "left": null, 328 | "margin": null, 329 | "max_height": null, 330 | "max_width": null, 331 | "min_height": null, 332 | "min_width": null, 333 | "object_fit": null, 334 | "object_position": null, 335 | "order": null, 336 | "overflow": null, 337 | "overflow_x": null, 338 | "overflow_y": null, 339 | "padding": null, 340 | "right": null, 341 | "top": null, 342 | "visibility": null, 343 | "width": null 344 | } 345 | }, 346 | "e9de96c18d0e45e5b32ce0d90043ce42": { 347 | "model_module": "@jupyter-widgets/controls", 348 | "model_name": "DescriptionStyleModel", 349 | "model_module_version": "1.5.0", 350 | "state": { 351 | "_model_module": "@jupyter-widgets/controls", 352 | "_model_module_version": "1.5.0", 353 | "_model_name": "DescriptionStyleModel", 354 | "_view_count": null, 355 | "_view_module": "@jupyter-widgets/base", 356 | "_view_module_version": "1.2.0", 357 | "_view_name": "StyleView", 358 | "description_width": "" 359 | } 360 | }, 361 | "2dc0247a47cd4337b56d4907457ccbba": { 362 | "model_module": "@jupyter-widgets/controls", 363 | "model_name": "HBoxModel", 364 | "model_module_version": "1.5.0", 365 | "state": { 366 | "_dom_classes": [], 367 | "_model_module": "@jupyter-widgets/controls", 368 | "_model_module_version": "1.5.0", 369 | "_model_name": "HBoxModel", 370 | "_view_count": null, 371 | "_view_module": "@jupyter-widgets/controls", 372 | "_view_module_version": "1.5.0", 373 | "_view_name": "HBoxView", 374 | "box_style": "", 375 | "children": [ 376 | "IPY_MODEL_c388ec8854994a50939a31817b006e5d", 377 | "IPY_MODEL_cfbb0fb9e6a04001941051b5dc27f503", 378 | "IPY_MODEL_2d42cdca79e443a19e9997c1fb88474c" 379 | ], 380 | "layout": "IPY_MODEL_c39c8d93c1044612a43fd35a7bc476cc" 381 | } 382 | }, 383 | "c388ec8854994a50939a31817b006e5d": { 384 | "model_module": "@jupyter-widgets/controls", 385 | "model_name": "HTMLModel", 386 | "model_module_version": "1.5.0", 387 | "state": { 388 | "_dom_classes": [], 389 | "_model_module": "@jupyter-widgets/controls", 390 | "_model_module_version": "1.5.0", 391 | "_model_name": "HTMLModel", 392 | "_view_count": null, 393 | "_view_module": "@jupyter-widgets/controls", 394 | "_view_module_version": "1.5.0", 395 | "_view_name": "HTMLView", 396 | "description": "", 397 | "description_tooltip": null, 398 | "layout": "IPY_MODEL_d6d65150405345298f68e3646d4c5539", 399 | "placeholder": "​", 400 | "style": "IPY_MODEL_ebe12af3475d4158a42cd9bf48fb53b2", 401 | "value": "tokenizer_config.json: 100%" 402 | } 403 | }, 404 | "cfbb0fb9e6a04001941051b5dc27f503": { 405 | "model_module": "@jupyter-widgets/controls", 406 | "model_name": "FloatProgressModel", 407 | "model_module_version": "1.5.0", 408 | "state": { 409 | "_dom_classes": [], 410 | "_model_module": "@jupyter-widgets/controls", 411 | "_model_module_version": "1.5.0", 412 | "_model_name": "FloatProgressModel", 413 | "_view_count": null, 414 | "_view_module": "@jupyter-widgets/controls", 415 | "_view_module_version": "1.5.0", 416 | "_view_name": "ProgressView", 417 | "bar_style": "success", 418 | "description": "", 419 | "description_tooltip": null, 420 | "layout": "IPY_MODEL_5a2a2f0e6cd2403b964748b7cd174654", 421 | "max": 700, 422 | "min": 0, 423 | "orientation": "horizontal", 424 | "style": "IPY_MODEL_0f1d935b3e224a5a8b996225591f6572", 425 | "value": 700 426 | } 427 | }, 428 | "2d42cdca79e443a19e9997c1fb88474c": { 429 | "model_module": "@jupyter-widgets/controls", 430 | "model_name": "HTMLModel", 431 | "model_module_version": "1.5.0", 432 | "state": { 433 | "_dom_classes": [], 434 | "_model_module": "@jupyter-widgets/controls", 435 | "_model_module_version": "1.5.0", 436 | "_model_name": "HTMLModel", 437 | "_view_count": null, 438 | "_view_module": "@jupyter-widgets/controls", 439 | "_view_module_version": "1.5.0", 440 | "_view_name": "HTMLView", 441 | "description": "", 442 | "description_tooltip": null, 443 | "layout": "IPY_MODEL_7028fe65757742dfa6d58f8185625696", 444 | "placeholder": "​", 445 | "style": "IPY_MODEL_5b5a09a9585240768ee2c52e06462db8", 446 | "value": " 700/700 [00:00<00:00, 29.8kB/s]" 447 | } 448 | }, 449 | "c39c8d93c1044612a43fd35a7bc476cc": { 450 | "model_module": "@jupyter-widgets/base", 451 | "model_name": "LayoutModel", 452 | "model_module_version": "1.2.0", 453 | "state": { 454 | "_model_module": "@jupyter-widgets/base", 455 | "_model_module_version": "1.2.0", 456 | "_model_name": "LayoutModel", 457 | "_view_count": null, 458 | "_view_module": "@jupyter-widgets/base", 459 | "_view_module_version": "1.2.0", 460 | "_view_name": "LayoutView", 461 | "align_content": null, 462 | "align_items": null, 463 | "align_self": null, 464 | "border": null, 465 | "bottom": null, 466 | "display": null, 467 | "flex": null, 468 | "flex_flow": null, 469 | "grid_area": null, 470 | "grid_auto_columns": null, 471 | "grid_auto_flow": null, 472 | "grid_auto_rows": null, 473 | "grid_column": null, 474 | "grid_gap": null, 475 | "grid_row": null, 476 | "grid_template_areas": null, 477 | "grid_template_columns": null, 478 | "grid_template_rows": null, 479 | "height": null, 480 | "justify_content": null, 481 | "justify_items": null, 482 | "left": null, 483 | "margin": null, 484 | "max_height": null, 485 | "max_width": null, 486 | "min_height": null, 487 | "min_width": null, 488 | "object_fit": null, 489 | "object_position": null, 490 | "order": null, 491 | "overflow": null, 492 | "overflow_x": null, 493 | "overflow_y": null, 494 | "padding": null, 495 | "right": null, 496 | "top": null, 497 | "visibility": null, 498 | "width": null 499 | } 500 | }, 501 | "d6d65150405345298f68e3646d4c5539": { 502 | "model_module": "@jupyter-widgets/base", 503 | "model_name": "LayoutModel", 504 | "model_module_version": "1.2.0", 505 | "state": { 506 | "_model_module": "@jupyter-widgets/base", 507 | "_model_module_version": "1.2.0", 508 | "_model_name": "LayoutModel", 509 | "_view_count": null, 510 | "_view_module": "@jupyter-widgets/base", 511 | "_view_module_version": "1.2.0", 512 | "_view_name": "LayoutView", 513 | "align_content": null, 514 | "align_items": null, 515 | "align_self": null, 516 | "border": null, 517 | "bottom": null, 518 | "display": null, 519 | "flex": null, 520 | "flex_flow": null, 521 | "grid_area": null, 522 | "grid_auto_columns": null, 523 | "grid_auto_flow": null, 524 | "grid_auto_rows": null, 525 | "grid_column": null, 526 | "grid_gap": null, 527 | "grid_row": null, 528 | "grid_template_areas": null, 529 | "grid_template_columns": null, 530 | "grid_template_rows": null, 531 | "height": null, 532 | "justify_content": null, 533 | "justify_items": null, 534 | "left": null, 535 | "margin": null, 536 | "max_height": null, 537 | "max_width": null, 538 | "min_height": null, 539 | "min_width": null, 540 | "object_fit": null, 541 | "object_position": null, 542 | "order": null, 543 | "overflow": null, 544 | "overflow_x": null, 545 | "overflow_y": null, 546 | "padding": null, 547 | "right": null, 548 | "top": null, 549 | "visibility": null, 550 | "width": null 551 | } 552 | }, 553 | "ebe12af3475d4158a42cd9bf48fb53b2": { 554 | "model_module": "@jupyter-widgets/controls", 555 | "model_name": "DescriptionStyleModel", 556 | "model_module_version": "1.5.0", 557 | "state": { 558 | "_model_module": "@jupyter-widgets/controls", 559 | "_model_module_version": "1.5.0", 560 | "_model_name": "DescriptionStyleModel", 561 | "_view_count": null, 562 | "_view_module": "@jupyter-widgets/base", 563 | "_view_module_version": "1.2.0", 564 | "_view_name": "StyleView", 565 | "description_width": "" 566 | } 567 | }, 568 | "5a2a2f0e6cd2403b964748b7cd174654": { 569 | "model_module": "@jupyter-widgets/base", 570 | "model_name": "LayoutModel", 571 | "model_module_version": "1.2.0", 572 | "state": { 573 | "_model_module": "@jupyter-widgets/base", 574 | "_model_module_version": "1.2.0", 575 | "_model_name": "LayoutModel", 576 | "_view_count": null, 577 | "_view_module": "@jupyter-widgets/base", 578 | "_view_module_version": "1.2.0", 579 | "_view_name": "LayoutView", 580 | "align_content": null, 581 | "align_items": null, 582 | "align_self": null, 583 | "border": null, 584 | "bottom": null, 585 | "display": null, 586 | "flex": null, 587 | "flex_flow": null, 588 | "grid_area": null, 589 | "grid_auto_columns": null, 590 | "grid_auto_flow": null, 591 | "grid_auto_rows": null, 592 | "grid_column": null, 593 | "grid_gap": null, 594 | "grid_row": null, 595 | "grid_template_areas": null, 596 | "grid_template_columns": null, 597 | "grid_template_rows": null, 598 | "height": null, 599 | "justify_content": null, 600 | "justify_items": null, 601 | "left": null, 602 | "margin": null, 603 | "max_height": null, 604 | "max_width": null, 605 | "min_height": null, 606 | "min_width": null, 607 | "object_fit": null, 608 | "object_position": null, 609 | "order": null, 610 | "overflow": null, 611 | "overflow_x": null, 612 | "overflow_y": null, 613 | "padding": null, 614 | "right": null, 615 | "top": null, 616 | "visibility": null, 617 | "width": null 618 | } 619 | }, 620 | "0f1d935b3e224a5a8b996225591f6572": { 621 | "model_module": "@jupyter-widgets/controls", 622 | "model_name": "ProgressStyleModel", 623 | "model_module_version": "1.5.0", 624 | "state": { 625 | "_model_module": "@jupyter-widgets/controls", 626 | "_model_module_version": "1.5.0", 627 | "_model_name": "ProgressStyleModel", 628 | "_view_count": null, 629 | "_view_module": "@jupyter-widgets/base", 630 | "_view_module_version": "1.2.0", 631 | "_view_name": "StyleView", 632 | "bar_color": null, 633 | "description_width": "" 634 | } 635 | }, 636 | "7028fe65757742dfa6d58f8185625696": { 637 | "model_module": "@jupyter-widgets/base", 638 | "model_name": "LayoutModel", 639 | "model_module_version": "1.2.0", 640 | "state": { 641 | "_model_module": "@jupyter-widgets/base", 642 | "_model_module_version": "1.2.0", 643 | "_model_name": "LayoutModel", 644 | "_view_count": null, 645 | "_view_module": "@jupyter-widgets/base", 646 | "_view_module_version": "1.2.0", 647 | "_view_name": "LayoutView", 648 | "align_content": null, 649 | "align_items": null, 650 | "align_self": null, 651 | "border": null, 652 | "bottom": null, 653 | "display": null, 654 | "flex": null, 655 | "flex_flow": null, 656 | "grid_area": null, 657 | "grid_auto_columns": null, 658 | "grid_auto_flow": null, 659 | "grid_auto_rows": null, 660 | "grid_column": null, 661 | "grid_gap": null, 662 | "grid_row": null, 663 | "grid_template_areas": null, 664 | "grid_template_columns": null, 665 | "grid_template_rows": null, 666 | "height": null, 667 | "justify_content": null, 668 | "justify_items": null, 669 | "left": null, 670 | "margin": null, 671 | "max_height": null, 672 | "max_width": null, 673 | "min_height": null, 674 | "min_width": null, 675 | "object_fit": null, 676 | "object_position": null, 677 | "order": null, 678 | "overflow": null, 679 | "overflow_x": null, 680 | "overflow_y": null, 681 | "padding": null, 682 | "right": null, 683 | "top": null, 684 | "visibility": null, 685 | "width": null 686 | } 687 | }, 688 | "5b5a09a9585240768ee2c52e06462db8": { 689 | "model_module": "@jupyter-widgets/controls", 690 | "model_name": "DescriptionStyleModel", 691 | "model_module_version": "1.5.0", 692 | "state": { 693 | "_model_module": "@jupyter-widgets/controls", 694 | "_model_module_version": "1.5.0", 695 | "_model_name": "DescriptionStyleModel", 696 | "_view_count": null, 697 | "_view_module": "@jupyter-widgets/base", 698 | "_view_module_version": "1.2.0", 699 | "_view_name": "StyleView", 700 | "description_width": "" 701 | } 702 | }, 703 | "237d9229c76e4c58b00b99ee61f2dfc5": { 704 | "model_module": "@jupyter-widgets/controls", 705 | "model_name": "HBoxModel", 706 | "model_module_version": "1.5.0", 707 | "state": { 708 | "_dom_classes": [], 709 | "_model_module": "@jupyter-widgets/controls", 710 | "_model_module_version": "1.5.0", 711 | "_model_name": "HBoxModel", 712 | "_view_count": null, 713 | "_view_module": "@jupyter-widgets/controls", 714 | "_view_module_version": "1.5.0", 715 | "_view_name": "HBoxView", 716 | "box_style": "", 717 | "children": [ 718 | "IPY_MODEL_9608a14f557b4149b4be726e006d39f3", 719 | "IPY_MODEL_d9de4b042ec047eb8a048c994bb76eff", 720 | "IPY_MODEL_d6385fe772274448bfa741ac8bb298a5" 721 | ], 722 | "layout": "IPY_MODEL_fe12816ac70f4a5b86893e6883d21eda" 723 | } 724 | }, 725 | "9608a14f557b4149b4be726e006d39f3": { 726 | "model_module": "@jupyter-widgets/controls", 727 | "model_name": "HTMLModel", 728 | "model_module_version": "1.5.0", 729 | "state": { 730 | "_dom_classes": [], 731 | "_model_module": "@jupyter-widgets/controls", 732 | "_model_module_version": "1.5.0", 733 | "_model_name": "HTMLModel", 734 | "_view_count": null, 735 | "_view_module": "@jupyter-widgets/controls", 736 | "_view_module_version": "1.5.0", 737 | "_view_name": "HTMLView", 738 | "description": "", 739 | "description_tooltip": null, 740 | "layout": "IPY_MODEL_2c71165f278849c2aa847926822bb823", 741 | "placeholder": "​", 742 | "style": "IPY_MODEL_b18951dbb1664171a89af76153057c27", 743 | "value": "tokenizer.model: 100%" 744 | } 745 | }, 746 | "d9de4b042ec047eb8a048c994bb76eff": { 747 | "model_module": "@jupyter-widgets/controls", 748 | "model_name": "FloatProgressModel", 749 | "model_module_version": "1.5.0", 750 | "state": { 751 | "_dom_classes": [], 752 | "_model_module": "@jupyter-widgets/controls", 753 | "_model_module_version": "1.5.0", 754 | "_model_name": "FloatProgressModel", 755 | "_view_count": null, 756 | "_view_module": "@jupyter-widgets/controls", 757 | "_view_module_version": "1.5.0", 758 | "_view_name": "ProgressView", 759 | "bar_style": "success", 760 | "description": "", 761 | "description_tooltip": null, 762 | "layout": "IPY_MODEL_ab78d6871bae4d64a57dc9efb7355029", 763 | "max": 499723, 764 | "min": 0, 765 | "orientation": "horizontal", 766 | "style": "IPY_MODEL_a2393815e27f4db39dbda0370776e15f", 767 | "value": 499723 768 | } 769 | }, 770 | "d6385fe772274448bfa741ac8bb298a5": { 771 | "model_module": "@jupyter-widgets/controls", 772 | "model_name": "HTMLModel", 773 | "model_module_version": "1.5.0", 774 | "state": { 775 | "_dom_classes": [], 776 | "_model_module": "@jupyter-widgets/controls", 777 | "_model_module_version": "1.5.0", 778 | "_model_name": "HTMLModel", 779 | "_view_count": null, 780 | "_view_module": "@jupyter-widgets/controls", 781 | "_view_module_version": "1.5.0", 782 | "_view_name": "HTMLView", 783 | "description": "", 784 | "description_tooltip": null, 785 | "layout": "IPY_MODEL_1adba38a840848cb92a153dc70db1956", 786 | "placeholder": "​", 787 | "style": "IPY_MODEL_f59e4c4874f946bfb506109b99518f97", 788 | "value": " 500k/500k [00:00<00:00, 7.63MB/s]" 789 | } 790 | }, 791 | "fe12816ac70f4a5b86893e6883d21eda": { 792 | "model_module": "@jupyter-widgets/base", 793 | "model_name": "LayoutModel", 794 | "model_module_version": "1.2.0", 795 | "state": { 796 | "_model_module": "@jupyter-widgets/base", 797 | "_model_module_version": "1.2.0", 798 | "_model_name": "LayoutModel", 799 | "_view_count": null, 800 | "_view_module": "@jupyter-widgets/base", 801 | "_view_module_version": "1.2.0", 802 | "_view_name": "LayoutView", 803 | "align_content": null, 804 | "align_items": null, 805 | "align_self": null, 806 | "border": null, 807 | "bottom": null, 808 | "display": null, 809 | "flex": null, 810 | "flex_flow": null, 811 | "grid_area": null, 812 | "grid_auto_columns": null, 813 | "grid_auto_flow": null, 814 | "grid_auto_rows": null, 815 | "grid_column": null, 816 | "grid_gap": null, 817 | "grid_row": null, 818 | "grid_template_areas": null, 819 | "grid_template_columns": null, 820 | "grid_template_rows": null, 821 | "height": null, 822 | "justify_content": null, 823 | "justify_items": null, 824 | "left": null, 825 | "margin": null, 826 | "max_height": null, 827 | "max_width": null, 828 | "min_height": null, 829 | "min_width": null, 830 | "object_fit": null, 831 | "object_position": null, 832 | "order": null, 833 | "overflow": null, 834 | "overflow_x": null, 835 | "overflow_y": null, 836 | "padding": null, 837 | "right": null, 838 | "top": null, 839 | "visibility": null, 840 | "width": null 841 | } 842 | }, 843 | "2c71165f278849c2aa847926822bb823": { 844 | "model_module": "@jupyter-widgets/base", 845 | "model_name": "LayoutModel", 846 | "model_module_version": "1.2.0", 847 | "state": { 848 | "_model_module": "@jupyter-widgets/base", 849 | "_model_module_version": "1.2.0", 850 | "_model_name": "LayoutModel", 851 | "_view_count": null, 852 | "_view_module": "@jupyter-widgets/base", 853 | "_view_module_version": "1.2.0", 854 | "_view_name": "LayoutView", 855 | "align_content": null, 856 | "align_items": null, 857 | "align_self": null, 858 | "border": null, 859 | "bottom": null, 860 | "display": null, 861 | "flex": null, 862 | "flex_flow": null, 863 | "grid_area": null, 864 | "grid_auto_columns": null, 865 | "grid_auto_flow": null, 866 | "grid_auto_rows": null, 867 | "grid_column": null, 868 | "grid_gap": null, 869 | "grid_row": null, 870 | "grid_template_areas": null, 871 | "grid_template_columns": null, 872 | "grid_template_rows": null, 873 | "height": null, 874 | "justify_content": null, 875 | "justify_items": null, 876 | "left": null, 877 | "margin": null, 878 | "max_height": null, 879 | "max_width": null, 880 | "min_height": null, 881 | "min_width": null, 882 | "object_fit": null, 883 | "object_position": null, 884 | "order": null, 885 | "overflow": null, 886 | "overflow_x": null, 887 | "overflow_y": null, 888 | "padding": null, 889 | "right": null, 890 | "top": null, 891 | "visibility": null, 892 | "width": null 893 | } 894 | }, 895 | "b18951dbb1664171a89af76153057c27": { 896 | "model_module": "@jupyter-widgets/controls", 897 | "model_name": "DescriptionStyleModel", 898 | "model_module_version": "1.5.0", 899 | "state": { 900 | "_model_module": "@jupyter-widgets/controls", 901 | "_model_module_version": "1.5.0", 902 | "_model_name": "DescriptionStyleModel", 903 | "_view_count": null, 904 | "_view_module": "@jupyter-widgets/base", 905 | "_view_module_version": "1.2.0", 906 | "_view_name": "StyleView", 907 | "description_width": "" 908 | } 909 | }, 910 | "ab78d6871bae4d64a57dc9efb7355029": { 911 | "model_module": "@jupyter-widgets/base", 912 | "model_name": "LayoutModel", 913 | "model_module_version": "1.2.0", 914 | "state": { 915 | "_model_module": "@jupyter-widgets/base", 916 | "_model_module_version": "1.2.0", 917 | "_model_name": "LayoutModel", 918 | "_view_count": null, 919 | "_view_module": "@jupyter-widgets/base", 920 | "_view_module_version": "1.2.0", 921 | "_view_name": "LayoutView", 922 | "align_content": null, 923 | "align_items": null, 924 | "align_self": null, 925 | "border": null, 926 | "bottom": null, 927 | "display": null, 928 | "flex": null, 929 | "flex_flow": null, 930 | "grid_area": null, 931 | "grid_auto_columns": null, 932 | "grid_auto_flow": null, 933 | "grid_auto_rows": null, 934 | "grid_column": null, 935 | "grid_gap": null, 936 | "grid_row": null, 937 | "grid_template_areas": null, 938 | "grid_template_columns": null, 939 | "grid_template_rows": null, 940 | "height": null, 941 | "justify_content": null, 942 | "justify_items": null, 943 | "left": null, 944 | "margin": null, 945 | "max_height": null, 946 | "max_width": null, 947 | "min_height": null, 948 | "min_width": null, 949 | "object_fit": null, 950 | "object_position": null, 951 | "order": null, 952 | "overflow": null, 953 | "overflow_x": null, 954 | "overflow_y": null, 955 | "padding": null, 956 | "right": null, 957 | "top": null, 958 | "visibility": null, 959 | "width": null 960 | } 961 | }, 962 | "a2393815e27f4db39dbda0370776e15f": { 963 | "model_module": "@jupyter-widgets/controls", 964 | "model_name": "ProgressStyleModel", 965 | "model_module_version": "1.5.0", 966 | "state": { 967 | "_model_module": "@jupyter-widgets/controls", 968 | "_model_module_version": "1.5.0", 969 | "_model_name": "ProgressStyleModel", 970 | "_view_count": null, 971 | "_view_module": "@jupyter-widgets/base", 972 | "_view_module_version": "1.2.0", 973 | "_view_name": "StyleView", 974 | "bar_color": null, 975 | "description_width": "" 976 | } 977 | }, 978 | "1adba38a840848cb92a153dc70db1956": { 979 | "model_module": "@jupyter-widgets/base", 980 | "model_name": "LayoutModel", 981 | "model_module_version": "1.2.0", 982 | "state": { 983 | "_model_module": "@jupyter-widgets/base", 984 | "_model_module_version": "1.2.0", 985 | "_model_name": "LayoutModel", 986 | "_view_count": null, 987 | "_view_module": "@jupyter-widgets/base", 988 | "_view_module_version": "1.2.0", 989 | "_view_name": "LayoutView", 990 | "align_content": null, 991 | "align_items": null, 992 | "align_self": null, 993 | "border": null, 994 | "bottom": null, 995 | "display": null, 996 | "flex": null, 997 | "flex_flow": null, 998 | "grid_area": null, 999 | "grid_auto_columns": null, 1000 | "grid_auto_flow": null, 1001 | "grid_auto_rows": null, 1002 | "grid_column": null, 1003 | "grid_gap": null, 1004 | "grid_row": null, 1005 | "grid_template_areas": null, 1006 | "grid_template_columns": null, 1007 | "grid_template_rows": null, 1008 | "height": null, 1009 | "justify_content": null, 1010 | "justify_items": null, 1011 | "left": null, 1012 | "margin": null, 1013 | "max_height": null, 1014 | "max_width": null, 1015 | "min_height": null, 1016 | "min_width": null, 1017 | "object_fit": null, 1018 | "object_position": null, 1019 | "order": null, 1020 | "overflow": null, 1021 | "overflow_x": null, 1022 | "overflow_y": null, 1023 | "padding": null, 1024 | "right": null, 1025 | "top": null, 1026 | "visibility": null, 1027 | "width": null 1028 | } 1029 | }, 1030 | "f59e4c4874f946bfb506109b99518f97": { 1031 | "model_module": "@jupyter-widgets/controls", 1032 | "model_name": "DescriptionStyleModel", 1033 | "model_module_version": "1.5.0", 1034 | "state": { 1035 | "_model_module": "@jupyter-widgets/controls", 1036 | "_model_module_version": "1.5.0", 1037 | "_model_name": "DescriptionStyleModel", 1038 | "_view_count": null, 1039 | "_view_module": "@jupyter-widgets/base", 1040 | "_view_module_version": "1.2.0", 1041 | "_view_name": "StyleView", 1042 | "description_width": "" 1043 | } 1044 | }, 1045 | "901239b3ed93485fa862e00c1b3f6ef7": { 1046 | "model_module": "@jupyter-widgets/controls", 1047 | "model_name": "HBoxModel", 1048 | "model_module_version": "1.5.0", 1049 | "state": { 1050 | "_dom_classes": [], 1051 | "_model_module": "@jupyter-widgets/controls", 1052 | "_model_module_version": "1.5.0", 1053 | "_model_name": "HBoxModel", 1054 | "_view_count": null, 1055 | "_view_module": "@jupyter-widgets/controls", 1056 | "_view_module_version": "1.5.0", 1057 | "_view_name": "HBoxView", 1058 | "box_style": "", 1059 | "children": [ 1060 | "IPY_MODEL_5db218a9d1a74059b19cbd1afaa7e486", 1061 | "IPY_MODEL_aa81cf4e5c394d87aa5b984cf4886966", 1062 | "IPY_MODEL_85e46d06d139496689d24c49d1c2d26d" 1063 | ], 1064 | "layout": "IPY_MODEL_314684e0aa4145f7a6253b427c314af1" 1065 | } 1066 | }, 1067 | "5db218a9d1a74059b19cbd1afaa7e486": { 1068 | "model_module": "@jupyter-widgets/controls", 1069 | "model_name": "HTMLModel", 1070 | "model_module_version": "1.5.0", 1071 | "state": { 1072 | "_dom_classes": [], 1073 | "_model_module": "@jupyter-widgets/controls", 1074 | "_model_module_version": "1.5.0", 1075 | "_model_name": "HTMLModel", 1076 | "_view_count": null, 1077 | "_view_module": "@jupyter-widgets/controls", 1078 | "_view_module_version": "1.5.0", 1079 | "_view_name": "HTMLView", 1080 | "description": "", 1081 | "description_tooltip": null, 1082 | "layout": "IPY_MODEL_7054b0f06dc84f6196c2c2b4b51b7f6f", 1083 | "placeholder": "​", 1084 | "style": "IPY_MODEL_5f3ec1a8f9c54f2ca09fa252d92e8ddf", 1085 | "value": "tokenizer.json: 100%" 1086 | } 1087 | }, 1088 | "aa81cf4e5c394d87aa5b984cf4886966": { 1089 | "model_module": "@jupyter-widgets/controls", 1090 | "model_name": "FloatProgressModel", 1091 | "model_module_version": "1.5.0", 1092 | "state": { 1093 | "_dom_classes": [], 1094 | "_model_module": "@jupyter-widgets/controls", 1095 | "_model_module_version": "1.5.0", 1096 | "_model_name": "FloatProgressModel", 1097 | "_view_count": null, 1098 | "_view_module": "@jupyter-widgets/controls", 1099 | "_view_module_version": "1.5.0", 1100 | "_view_name": "ProgressView", 1101 | "bar_style": "success", 1102 | "description": "", 1103 | "description_tooltip": null, 1104 | "layout": "IPY_MODEL_126bff20f4b04fb5a4238f661d8f0310", 1105 | "max": 1842764, 1106 | "min": 0, 1107 | "orientation": "horizontal", 1108 | "style": "IPY_MODEL_930733b0823a4c96bf76c5896f5e985b", 1109 | "value": 1842764 1110 | } 1111 | }, 1112 | "85e46d06d139496689d24c49d1c2d26d": { 1113 | "model_module": "@jupyter-widgets/controls", 1114 | "model_name": "HTMLModel", 1115 | "model_module_version": "1.5.0", 1116 | "state": { 1117 | "_dom_classes": [], 1118 | "_model_module": "@jupyter-widgets/controls", 1119 | "_model_module_version": "1.5.0", 1120 | "_model_name": "HTMLModel", 1121 | "_view_count": null, 1122 | "_view_module": "@jupyter-widgets/controls", 1123 | "_view_module_version": "1.5.0", 1124 | "_view_name": "HTMLView", 1125 | "description": "", 1126 | "description_tooltip": null, 1127 | "layout": "IPY_MODEL_0f44af97fc504ae69202511e6feff072", 1128 | "placeholder": "​", 1129 | "style": "IPY_MODEL_1e2fa67cf7d248c692f4d67e7cda5846", 1130 | "value": " 1.84M/1.84M [00:00<00:00, 14.6MB/s]" 1131 | } 1132 | }, 1133 | "314684e0aa4145f7a6253b427c314af1": { 1134 | "model_module": "@jupyter-widgets/base", 1135 | "model_name": "LayoutModel", 1136 | "model_module_version": "1.2.0", 1137 | "state": { 1138 | "_model_module": "@jupyter-widgets/base", 1139 | "_model_module_version": "1.2.0", 1140 | "_model_name": "LayoutModel", 1141 | "_view_count": null, 1142 | "_view_module": "@jupyter-widgets/base", 1143 | "_view_module_version": "1.2.0", 1144 | "_view_name": "LayoutView", 1145 | "align_content": null, 1146 | "align_items": null, 1147 | "align_self": null, 1148 | "border": null, 1149 | "bottom": null, 1150 | "display": null, 1151 | "flex": null, 1152 | "flex_flow": null, 1153 | "grid_area": null, 1154 | "grid_auto_columns": null, 1155 | "grid_auto_flow": null, 1156 | "grid_auto_rows": null, 1157 | "grid_column": null, 1158 | "grid_gap": null, 1159 | "grid_row": null, 1160 | "grid_template_areas": null, 1161 | "grid_template_columns": null, 1162 | "grid_template_rows": null, 1163 | "height": null, 1164 | "justify_content": null, 1165 | "justify_items": null, 1166 | "left": null, 1167 | "margin": null, 1168 | "max_height": null, 1169 | "max_width": null, 1170 | "min_height": null, 1171 | "min_width": null, 1172 | "object_fit": null, 1173 | "object_position": null, 1174 | "order": null, 1175 | "overflow": null, 1176 | "overflow_x": null, 1177 | "overflow_y": null, 1178 | "padding": null, 1179 | "right": null, 1180 | "top": null, 1181 | "visibility": null, 1182 | "width": null 1183 | } 1184 | }, 1185 | "7054b0f06dc84f6196c2c2b4b51b7f6f": { 1186 | "model_module": "@jupyter-widgets/base", 1187 | "model_name": "LayoutModel", 1188 | "model_module_version": "1.2.0", 1189 | "state": { 1190 | "_model_module": "@jupyter-widgets/base", 1191 | "_model_module_version": "1.2.0", 1192 | "_model_name": "LayoutModel", 1193 | "_view_count": null, 1194 | "_view_module": "@jupyter-widgets/base", 1195 | "_view_module_version": "1.2.0", 1196 | "_view_name": "LayoutView", 1197 | "align_content": null, 1198 | "align_items": null, 1199 | "align_self": null, 1200 | "border": null, 1201 | "bottom": null, 1202 | "display": null, 1203 | "flex": null, 1204 | "flex_flow": null, 1205 | "grid_area": null, 1206 | "grid_auto_columns": null, 1207 | "grid_auto_flow": null, 1208 | "grid_auto_rows": null, 1209 | "grid_column": null, 1210 | "grid_gap": null, 1211 | "grid_row": null, 1212 | "grid_template_areas": null, 1213 | "grid_template_columns": null, 1214 | "grid_template_rows": null, 1215 | "height": null, 1216 | "justify_content": null, 1217 | "justify_items": null, 1218 | "left": null, 1219 | "margin": null, 1220 | "max_height": null, 1221 | "max_width": null, 1222 | "min_height": null, 1223 | "min_width": null, 1224 | "object_fit": null, 1225 | "object_position": null, 1226 | "order": null, 1227 | "overflow": null, 1228 | "overflow_x": null, 1229 | "overflow_y": null, 1230 | "padding": null, 1231 | "right": null, 1232 | "top": null, 1233 | "visibility": null, 1234 | "width": null 1235 | } 1236 | }, 1237 | "5f3ec1a8f9c54f2ca09fa252d92e8ddf": { 1238 | "model_module": "@jupyter-widgets/controls", 1239 | "model_name": "DescriptionStyleModel", 1240 | "model_module_version": "1.5.0", 1241 | "state": { 1242 | "_model_module": "@jupyter-widgets/controls", 1243 | "_model_module_version": "1.5.0", 1244 | "_model_name": "DescriptionStyleModel", 1245 | "_view_count": null, 1246 | "_view_module": "@jupyter-widgets/base", 1247 | "_view_module_version": "1.2.0", 1248 | "_view_name": "StyleView", 1249 | "description_width": "" 1250 | } 1251 | }, 1252 | "126bff20f4b04fb5a4238f661d8f0310": { 1253 | "model_module": "@jupyter-widgets/base", 1254 | "model_name": "LayoutModel", 1255 | "model_module_version": "1.2.0", 1256 | "state": { 1257 | "_model_module": "@jupyter-widgets/base", 1258 | "_model_module_version": "1.2.0", 1259 | "_model_name": "LayoutModel", 1260 | "_view_count": null, 1261 | "_view_module": "@jupyter-widgets/base", 1262 | "_view_module_version": "1.2.0", 1263 | "_view_name": "LayoutView", 1264 | "align_content": null, 1265 | "align_items": null, 1266 | "align_self": null, 1267 | "border": null, 1268 | "bottom": null, 1269 | "display": null, 1270 | "flex": null, 1271 | "flex_flow": null, 1272 | "grid_area": null, 1273 | "grid_auto_columns": null, 1274 | "grid_auto_flow": null, 1275 | "grid_auto_rows": null, 1276 | "grid_column": null, 1277 | "grid_gap": null, 1278 | "grid_row": null, 1279 | "grid_template_areas": null, 1280 | "grid_template_columns": null, 1281 | "grid_template_rows": null, 1282 | "height": null, 1283 | "justify_content": null, 1284 | "justify_items": null, 1285 | "left": null, 1286 | "margin": null, 1287 | "max_height": null, 1288 | "max_width": null, 1289 | "min_height": null, 1290 | "min_width": null, 1291 | "object_fit": null, 1292 | "object_position": null, 1293 | "order": null, 1294 | "overflow": null, 1295 | "overflow_x": null, 1296 | "overflow_y": null, 1297 | "padding": null, 1298 | "right": null, 1299 | "top": null, 1300 | "visibility": null, 1301 | "width": null 1302 | } 1303 | }, 1304 | "930733b0823a4c96bf76c5896f5e985b": { 1305 | "model_module": "@jupyter-widgets/controls", 1306 | "model_name": "ProgressStyleModel", 1307 | "model_module_version": "1.5.0", 1308 | "state": { 1309 | "_model_module": "@jupyter-widgets/controls", 1310 | "_model_module_version": "1.5.0", 1311 | "_model_name": "ProgressStyleModel", 1312 | "_view_count": null, 1313 | "_view_module": "@jupyter-widgets/base", 1314 | "_view_module_version": "1.2.0", 1315 | "_view_name": "StyleView", 1316 | "bar_color": null, 1317 | "description_width": "" 1318 | } 1319 | }, 1320 | "0f44af97fc504ae69202511e6feff072": { 1321 | "model_module": "@jupyter-widgets/base", 1322 | "model_name": "LayoutModel", 1323 | "model_module_version": "1.2.0", 1324 | "state": { 1325 | "_model_module": "@jupyter-widgets/base", 1326 | "_model_module_version": "1.2.0", 1327 | "_model_name": "LayoutModel", 1328 | "_view_count": null, 1329 | "_view_module": "@jupyter-widgets/base", 1330 | "_view_module_version": "1.2.0", 1331 | "_view_name": "LayoutView", 1332 | "align_content": null, 1333 | "align_items": null, 1334 | "align_self": null, 1335 | "border": null, 1336 | "bottom": null, 1337 | "display": null, 1338 | "flex": null, 1339 | "flex_flow": null, 1340 | "grid_area": null, 1341 | "grid_auto_columns": null, 1342 | "grid_auto_flow": null, 1343 | "grid_auto_rows": null, 1344 | "grid_column": null, 1345 | "grid_gap": null, 1346 | "grid_row": null, 1347 | "grid_template_areas": null, 1348 | "grid_template_columns": null, 1349 | "grid_template_rows": null, 1350 | "height": null, 1351 | "justify_content": null, 1352 | "justify_items": null, 1353 | "left": null, 1354 | "margin": null, 1355 | "max_height": null, 1356 | "max_width": null, 1357 | "min_height": null, 1358 | "min_width": null, 1359 | "object_fit": null, 1360 | "object_position": null, 1361 | "order": null, 1362 | "overflow": null, 1363 | "overflow_x": null, 1364 | "overflow_y": null, 1365 | "padding": null, 1366 | "right": null, 1367 | "top": null, 1368 | "visibility": null, 1369 | "width": null 1370 | } 1371 | }, 1372 | "1e2fa67cf7d248c692f4d67e7cda5846": { 1373 | "model_module": "@jupyter-widgets/controls", 1374 | "model_name": "DescriptionStyleModel", 1375 | "model_module_version": "1.5.0", 1376 | "state": { 1377 | "_model_module": "@jupyter-widgets/controls", 1378 | "_model_module_version": "1.5.0", 1379 | "_model_name": "DescriptionStyleModel", 1380 | "_view_count": null, 1381 | "_view_module": "@jupyter-widgets/base", 1382 | "_view_module_version": "1.2.0", 1383 | "_view_name": "StyleView", 1384 | "description_width": "" 1385 | } 1386 | }, 1387 | "3981ee8e5431479b8fa611575c8d4139": { 1388 | "model_module": "@jupyter-widgets/controls", 1389 | "model_name": "HBoxModel", 1390 | "model_module_version": "1.5.0", 1391 | "state": { 1392 | "_dom_classes": [], 1393 | "_model_module": "@jupyter-widgets/controls", 1394 | "_model_module_version": "1.5.0", 1395 | "_model_name": "HBoxModel", 1396 | "_view_count": null, 1397 | "_view_module": "@jupyter-widgets/controls", 1398 | "_view_module_version": "1.5.0", 1399 | "_view_name": "HBoxView", 1400 | "box_style": "", 1401 | "children": [ 1402 | "IPY_MODEL_99e44b3765dd4b19a099cee200a5b39d", 1403 | "IPY_MODEL_d9567248d700429686d61a51da356e81", 1404 | "IPY_MODEL_47ef1b7e6146477ca34a576413062eee" 1405 | ], 1406 | "layout": "IPY_MODEL_dec2ff397e2e426fb70032f90a452022" 1407 | } 1408 | }, 1409 | "99e44b3765dd4b19a099cee200a5b39d": { 1410 | "model_module": "@jupyter-widgets/controls", 1411 | "model_name": "HTMLModel", 1412 | "model_module_version": "1.5.0", 1413 | "state": { 1414 | "_dom_classes": [], 1415 | "_model_module": "@jupyter-widgets/controls", 1416 | "_model_module_version": "1.5.0", 1417 | "_model_name": "HTMLModel", 1418 | "_view_count": null, 1419 | "_view_module": "@jupyter-widgets/controls", 1420 | "_view_module_version": "1.5.0", 1421 | "_view_name": "HTMLView", 1422 | "description": "", 1423 | "description_tooltip": null, 1424 | "layout": "IPY_MODEL_38e9d04fc5ff479fa8ac1f29585f5b28", 1425 | "placeholder": "​", 1426 | "style": "IPY_MODEL_03550f7e37d84bff9077d53d69f70658", 1427 | "value": "special_tokens_map.json: 100%" 1428 | } 1429 | }, 1430 | "d9567248d700429686d61a51da356e81": { 1431 | "model_module": "@jupyter-widgets/controls", 1432 | "model_name": "FloatProgressModel", 1433 | "model_module_version": "1.5.0", 1434 | "state": { 1435 | "_dom_classes": [], 1436 | "_model_module": "@jupyter-widgets/controls", 1437 | "_model_module_version": "1.5.0", 1438 | "_model_name": "FloatProgressModel", 1439 | "_view_count": null, 1440 | "_view_module": "@jupyter-widgets/controls", 1441 | "_view_module_version": "1.5.0", 1442 | "_view_name": "ProgressView", 1443 | "bar_style": "success", 1444 | "description": "", 1445 | "description_tooltip": null, 1446 | "layout": "IPY_MODEL_713b31e14f8245c488a5e24b22cdccde", 1447 | "max": 411, 1448 | "min": 0, 1449 | "orientation": "horizontal", 1450 | "style": "IPY_MODEL_87226a52d88e4cfe9ad88046e4112270", 1451 | "value": 411 1452 | } 1453 | }, 1454 | "47ef1b7e6146477ca34a576413062eee": { 1455 | "model_module": "@jupyter-widgets/controls", 1456 | "model_name": "HTMLModel", 1457 | "model_module_version": "1.5.0", 1458 | "state": { 1459 | "_dom_classes": [], 1460 | "_model_module": "@jupyter-widgets/controls", 1461 | "_model_module_version": "1.5.0", 1462 | "_model_name": "HTMLModel", 1463 | "_view_count": null, 1464 | "_view_module": "@jupyter-widgets/controls", 1465 | "_view_module_version": "1.5.0", 1466 | "_view_name": "HTMLView", 1467 | "description": "", 1468 | "description_tooltip": null, 1469 | "layout": "IPY_MODEL_865ddc435e7f4e37b924107554a5b4de", 1470 | "placeholder": "​", 1471 | "style": "IPY_MODEL_de796d7ef73d4937917879592769dbf2", 1472 | "value": " 411/411 [00:00<00:00, 27.5kB/s]" 1473 | } 1474 | }, 1475 | "dec2ff397e2e426fb70032f90a452022": { 1476 | "model_module": "@jupyter-widgets/base", 1477 | "model_name": "LayoutModel", 1478 | "model_module_version": "1.2.0", 1479 | "state": { 1480 | "_model_module": "@jupyter-widgets/base", 1481 | "_model_module_version": "1.2.0", 1482 | "_model_name": "LayoutModel", 1483 | "_view_count": null, 1484 | "_view_module": "@jupyter-widgets/base", 1485 | "_view_module_version": "1.2.0", 1486 | "_view_name": "LayoutView", 1487 | "align_content": null, 1488 | "align_items": null, 1489 | "align_self": null, 1490 | "border": null, 1491 | "bottom": null, 1492 | "display": null, 1493 | "flex": null, 1494 | "flex_flow": null, 1495 | "grid_area": null, 1496 | "grid_auto_columns": null, 1497 | "grid_auto_flow": null, 1498 | "grid_auto_rows": null, 1499 | "grid_column": null, 1500 | "grid_gap": null, 1501 | "grid_row": null, 1502 | "grid_template_areas": null, 1503 | "grid_template_columns": null, 1504 | "grid_template_rows": null, 1505 | "height": null, 1506 | "justify_content": null, 1507 | "justify_items": null, 1508 | "left": null, 1509 | "margin": null, 1510 | "max_height": null, 1511 | "max_width": null, 1512 | "min_height": null, 1513 | "min_width": null, 1514 | "object_fit": null, 1515 | "object_position": null, 1516 | "order": null, 1517 | "overflow": null, 1518 | "overflow_x": null, 1519 | "overflow_y": null, 1520 | "padding": null, 1521 | "right": null, 1522 | "top": null, 1523 | "visibility": null, 1524 | "width": null 1525 | } 1526 | }, 1527 | "38e9d04fc5ff479fa8ac1f29585f5b28": { 1528 | "model_module": "@jupyter-widgets/base", 1529 | "model_name": "LayoutModel", 1530 | "model_module_version": "1.2.0", 1531 | "state": { 1532 | "_model_module": "@jupyter-widgets/base", 1533 | "_model_module_version": "1.2.0", 1534 | "_model_name": "LayoutModel", 1535 | "_view_count": null, 1536 | "_view_module": "@jupyter-widgets/base", 1537 | "_view_module_version": "1.2.0", 1538 | "_view_name": "LayoutView", 1539 | "align_content": null, 1540 | "align_items": null, 1541 | "align_self": null, 1542 | "border": null, 1543 | "bottom": null, 1544 | "display": null, 1545 | "flex": null, 1546 | "flex_flow": null, 1547 | "grid_area": null, 1548 | "grid_auto_columns": null, 1549 | "grid_auto_flow": null, 1550 | "grid_auto_rows": null, 1551 | "grid_column": null, 1552 | "grid_gap": null, 1553 | "grid_row": null, 1554 | "grid_template_areas": null, 1555 | "grid_template_columns": null, 1556 | "grid_template_rows": null, 1557 | "height": null, 1558 | "justify_content": null, 1559 | "justify_items": null, 1560 | "left": null, 1561 | "margin": null, 1562 | "max_height": null, 1563 | "max_width": null, 1564 | "min_height": null, 1565 | "min_width": null, 1566 | "object_fit": null, 1567 | "object_position": null, 1568 | "order": null, 1569 | "overflow": null, 1570 | "overflow_x": null, 1571 | "overflow_y": null, 1572 | "padding": null, 1573 | "right": null, 1574 | "top": null, 1575 | "visibility": null, 1576 | "width": null 1577 | } 1578 | }, 1579 | "03550f7e37d84bff9077d53d69f70658": { 1580 | "model_module": "@jupyter-widgets/controls", 1581 | "model_name": "DescriptionStyleModel", 1582 | "model_module_version": "1.5.0", 1583 | "state": { 1584 | "_model_module": "@jupyter-widgets/controls", 1585 | "_model_module_version": "1.5.0", 1586 | "_model_name": "DescriptionStyleModel", 1587 | "_view_count": null, 1588 | "_view_module": "@jupyter-widgets/base", 1589 | "_view_module_version": "1.2.0", 1590 | "_view_name": "StyleView", 1591 | "description_width": "" 1592 | } 1593 | }, 1594 | "713b31e14f8245c488a5e24b22cdccde": { 1595 | "model_module": "@jupyter-widgets/base", 1596 | "model_name": "LayoutModel", 1597 | "model_module_version": "1.2.0", 1598 | "state": { 1599 | "_model_module": "@jupyter-widgets/base", 1600 | "_model_module_version": "1.2.0", 1601 | "_model_name": "LayoutModel", 1602 | "_view_count": null, 1603 | "_view_module": "@jupyter-widgets/base", 1604 | "_view_module_version": "1.2.0", 1605 | "_view_name": "LayoutView", 1606 | "align_content": null, 1607 | "align_items": null, 1608 | "align_self": null, 1609 | "border": null, 1610 | "bottom": null, 1611 | "display": null, 1612 | "flex": null, 1613 | "flex_flow": null, 1614 | "grid_area": null, 1615 | "grid_auto_columns": null, 1616 | "grid_auto_flow": null, 1617 | "grid_auto_rows": null, 1618 | "grid_column": null, 1619 | "grid_gap": null, 1620 | "grid_row": null, 1621 | "grid_template_areas": null, 1622 | "grid_template_columns": null, 1623 | "grid_template_rows": null, 1624 | "height": null, 1625 | "justify_content": null, 1626 | "justify_items": null, 1627 | "left": null, 1628 | "margin": null, 1629 | "max_height": null, 1630 | "max_width": null, 1631 | "min_height": null, 1632 | "min_width": null, 1633 | "object_fit": null, 1634 | "object_position": null, 1635 | "order": null, 1636 | "overflow": null, 1637 | "overflow_x": null, 1638 | "overflow_y": null, 1639 | "padding": null, 1640 | "right": null, 1641 | "top": null, 1642 | "visibility": null, 1643 | "width": null 1644 | } 1645 | }, 1646 | "87226a52d88e4cfe9ad88046e4112270": { 1647 | "model_module": "@jupyter-widgets/controls", 1648 | "model_name": "ProgressStyleModel", 1649 | "model_module_version": "1.5.0", 1650 | "state": { 1651 | "_model_module": "@jupyter-widgets/controls", 1652 | "_model_module_version": "1.5.0", 1653 | "_model_name": "ProgressStyleModel", 1654 | "_view_count": null, 1655 | "_view_module": "@jupyter-widgets/base", 1656 | "_view_module_version": "1.2.0", 1657 | "_view_name": "StyleView", 1658 | "bar_color": null, 1659 | "description_width": "" 1660 | } 1661 | }, 1662 | "865ddc435e7f4e37b924107554a5b4de": { 1663 | "model_module": "@jupyter-widgets/base", 1664 | "model_name": "LayoutModel", 1665 | "model_module_version": "1.2.0", 1666 | "state": { 1667 | "_model_module": "@jupyter-widgets/base", 1668 | "_model_module_version": "1.2.0", 1669 | "_model_name": "LayoutModel", 1670 | "_view_count": null, 1671 | "_view_module": "@jupyter-widgets/base", 1672 | "_view_module_version": "1.2.0", 1673 | "_view_name": "LayoutView", 1674 | "align_content": null, 1675 | "align_items": null, 1676 | "align_self": null, 1677 | "border": null, 1678 | "bottom": null, 1679 | "display": null, 1680 | "flex": null, 1681 | "flex_flow": null, 1682 | "grid_area": null, 1683 | "grid_auto_columns": null, 1684 | "grid_auto_flow": null, 1685 | "grid_auto_rows": null, 1686 | "grid_column": null, 1687 | "grid_gap": null, 1688 | "grid_row": null, 1689 | "grid_template_areas": null, 1690 | "grid_template_columns": null, 1691 | "grid_template_rows": null, 1692 | "height": null, 1693 | "justify_content": null, 1694 | "justify_items": null, 1695 | "left": null, 1696 | "margin": null, 1697 | "max_height": null, 1698 | "max_width": null, 1699 | "min_height": null, 1700 | "min_width": null, 1701 | "object_fit": null, 1702 | "object_position": null, 1703 | "order": null, 1704 | "overflow": null, 1705 | "overflow_x": null, 1706 | "overflow_y": null, 1707 | "padding": null, 1708 | "right": null, 1709 | "top": null, 1710 | "visibility": null, 1711 | "width": null 1712 | } 1713 | }, 1714 | "de796d7ef73d4937917879592769dbf2": { 1715 | "model_module": "@jupyter-widgets/controls", 1716 | "model_name": "DescriptionStyleModel", 1717 | "model_module_version": "1.5.0", 1718 | "state": { 1719 | "_model_module": "@jupyter-widgets/controls", 1720 | "_model_module_version": "1.5.0", 1721 | "_model_name": "DescriptionStyleModel", 1722 | "_view_count": null, 1723 | "_view_module": "@jupyter-widgets/base", 1724 | "_view_module_version": "1.2.0", 1725 | "_view_name": "StyleView", 1726 | "description_width": "" 1727 | } 1728 | } 1729 | } 1730 | } 1731 | }, 1732 | "cells": [ 1733 | { 1734 | "cell_type": "code", 1735 | "execution_count": 10, 1736 | "metadata": { 1737 | "id": "GLXwJqbjtPho", 1738 | "colab": { 1739 | "base_uri": "https://localhost:8080/", 1740 | "height": 321 1741 | }, 1742 | "outputId": "cd911fc7-b4ee-48da-c173-e7c9a6929136" 1743 | }, 1744 | "outputs": [ 1745 | { 1746 | "output_type": "error", 1747 | "ename": "NotImplementedError", 1748 | "evalue": "A UTF-8 locale is required. Got ANSI_X3.4-1968", 1749 | "traceback": [ 1750 | "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", 1751 | "\u001b[0;31mNotImplementedError\u001b[0m Traceback (most recent call last)", 1752 | "\u001b[0;32m\u001b[0m in \u001b[0;36m\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mget_ipython\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msystem\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m'pip install -q accelerate==0.21.0 peft==0.4.0 bitsandbytes==0.40.2 transformers==4.31.0 trl==0.4.7 wandb langchain'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m", 1753 | "\u001b[0;32m/usr/local/lib/python3.10/dist-packages/google/colab/_shell.py\u001b[0m in \u001b[0;36msystem\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 97\u001b[0m \u001b[0mkwargs\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mupdate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m{\u001b[0m\u001b[0;34m'also_return_output'\u001b[0m\u001b[0;34m:\u001b[0m \u001b[0;32mTrue\u001b[0m\u001b[0;34m}\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 98\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 99\u001b[0;31m \u001b[0moutput\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0m_system_commands\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_system_compat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;31m# pylint:disable=protected-access\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 100\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 101\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mpip_warn\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", 1754 | "\u001b[0;32m/usr/local/lib/python3.10/dist-packages/google/colab/_system_commands.py\u001b[0m in \u001b[0;36m_system_compat\u001b[0;34m(shell, cmd, also_return_output)\u001b[0m\n\u001b[1;32m 452\u001b[0m \u001b[0;31m# is expected to call this function, thus adding one level of nesting to the\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 453\u001b[0m \u001b[0;31m# stack.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 454\u001b[0;31m result = _run_command(\n\u001b[0m\u001b[1;32m 455\u001b[0m \u001b[0mshell\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mvar_expand\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mcmd\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdepth\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mclear_streamed_output\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mFalse\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 456\u001b[0m )\n", 1755 | "\u001b[0;32m/usr/local/lib/python3.10/dist-packages/google/colab/_system_commands.py\u001b[0m in \u001b[0;36m_run_command\u001b[0;34m(cmd, clear_streamed_output)\u001b[0m\n\u001b[1;32m 166\u001b[0m \u001b[0mlocale_encoding\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mlocale\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgetpreferredencoding\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 167\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mlocale_encoding\u001b[0m \u001b[0;34m!=\u001b[0m \u001b[0m_ENCODING\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 168\u001b[0;31m raise NotImplementedError(\n\u001b[0m\u001b[1;32m 169\u001b[0m \u001b[0;34m'A UTF-8 locale is required. Got {}'\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mformat\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlocale_encoding\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 170\u001b[0m )\n", 1756 | "\u001b[0;31mNotImplementedError\u001b[0m: A UTF-8 locale is required. Got ANSI_X3.4-1968" 1757 | ] 1758 | } 1759 | ], 1760 | "source": [ 1761 | "!pip install -q accelerate==0.21.0 peft==0.4.0 bitsandbytes==0.40.2 transformers trl==0.4.7 wandb langchain" 1762 | ] 1763 | }, 1764 | { 1765 | "cell_type": "code", 1766 | "source": [ 1767 | "import locale\n", 1768 | "locale.getpreferredencoding = lambda: \"UTF-8\"" 1769 | ], 1770 | "metadata": { 1771 | "id": "rsIP45Eqv9LN" 1772 | }, 1773 | "execution_count": 11, 1774 | "outputs": [] 1775 | }, 1776 | { 1777 | "cell_type": "code", 1778 | "source": [ 1779 | "!pip install langchain" 1780 | ], 1781 | "metadata": { 1782 | "colab": { 1783 | "base_uri": "https://localhost:8080/" 1784 | }, 1785 | "id": "qMLO9Cpzv-Hc", 1786 | "outputId": "f659cce8-1ae2-4eff-a630-90271b6313aa" 1787 | }, 1788 | "execution_count": 12, 1789 | "outputs": [ 1790 | { 1791 | "output_type": "stream", 1792 | "name": "stdout", 1793 | "text": [ 1794 | "Collecting langchain\n", 1795 | " Downloading langchain-0.1.1-py3-none-any.whl (802 kB)\n", 1796 | "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m802.4/802.4 kB\u001b[0m \u001b[31m3.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", 1797 | "\u001b[?25hRequirement already satisfied: PyYAML>=5.3 in /usr/local/lib/python3.10/dist-packages (from langchain) (6.0.1)\n", 1798 | "Requirement already satisfied: SQLAlchemy<3,>=1.4 in /usr/local/lib/python3.10/dist-packages (from langchain) (2.0.24)\n", 1799 | "Requirement already satisfied: aiohttp<4.0.0,>=3.8.3 in /usr/local/lib/python3.10/dist-packages (from langchain) (3.9.1)\n", 1800 | "Requirement already satisfied: async-timeout<5.0.0,>=4.0.0 in /usr/local/lib/python3.10/dist-packages (from langchain) (4.0.3)\n", 1801 | "Collecting dataclasses-json<0.7,>=0.5.7 (from langchain)\n", 1802 | " Downloading dataclasses_json-0.6.3-py3-none-any.whl (28 kB)\n", 1803 | "Collecting jsonpatch<2.0,>=1.33 (from langchain)\n", 1804 | " Downloading jsonpatch-1.33-py2.py3-none-any.whl (12 kB)\n", 1805 | "Collecting langchain-community<0.1,>=0.0.13 (from langchain)\n", 1806 | " Downloading langchain_community-0.0.13-py3-none-any.whl (1.6 MB)\n", 1807 | "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.6/1.6 MB\u001b[0m \u001b[31m21.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", 1808 | "\u001b[?25hCollecting langchain-core<0.2,>=0.1.9 (from langchain)\n", 1809 | " Downloading langchain_core-0.1.13-py3-none-any.whl (228 kB)\n", 1810 | "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m228.7/228.7 kB\u001b[0m \u001b[31m18.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", 1811 | "\u001b[?25hCollecting langsmith<0.1.0,>=0.0.77 (from langchain)\n", 1812 | " Downloading langsmith-0.0.83-py3-none-any.whl (49 kB)\n", 1813 | "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m49.3/49.3 kB\u001b[0m \u001b[31m6.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", 1814 | "\u001b[?25hRequirement already satisfied: numpy<2,>=1 in /usr/local/lib/python3.10/dist-packages (from langchain) (1.23.5)\n", 1815 | "Requirement already satisfied: pydantic<3,>=1 in /usr/local/lib/python3.10/dist-packages (from langchain) (1.10.13)\n", 1816 | "Requirement already satisfied: requests<3,>=2 in /usr/local/lib/python3.10/dist-packages (from langchain) (2.31.0)\n", 1817 | "Requirement already satisfied: tenacity<9.0.0,>=8.1.0 in /usr/local/lib/python3.10/dist-packages (from langchain) (8.2.3)\n", 1818 | "Requirement already satisfied: attrs>=17.3.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (23.2.0)\n", 1819 | "Requirement already satisfied: multidict<7.0,>=4.5 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (6.0.4)\n", 1820 | "Requirement already satisfied: yarl<2.0,>=1.0 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (1.9.4)\n", 1821 | "Requirement already satisfied: frozenlist>=1.1.1 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (1.4.1)\n", 1822 | "Requirement already satisfied: aiosignal>=1.1.2 in /usr/local/lib/python3.10/dist-packages (from aiohttp<4.0.0,>=3.8.3->langchain) (1.3.1)\n", 1823 | "Collecting marshmallow<4.0.0,>=3.18.0 (from dataclasses-json<0.7,>=0.5.7->langchain)\n", 1824 | " Downloading marshmallow-3.20.2-py3-none-any.whl (49 kB)\n", 1825 | "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m49.4/49.4 kB\u001b[0m \u001b[31m5.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n", 1826 | "\u001b[?25hCollecting typing-inspect<1,>=0.4.0 (from dataclasses-json<0.7,>=0.5.7->langchain)\n", 1827 | " Downloading typing_inspect-0.9.0-py3-none-any.whl (8.8 kB)\n", 1828 | "Collecting jsonpointer>=1.9 (from jsonpatch<2.0,>=1.33->langchain)\n", 1829 | " Downloading jsonpointer-2.4-py2.py3-none-any.whl (7.8 kB)\n", 1830 | "Requirement already satisfied: anyio<5,>=3 in /usr/local/lib/python3.10/dist-packages (from langchain-core<0.2,>=0.1.9->langchain) (3.7.1)\n", 1831 | "Requirement already satisfied: packaging<24.0,>=23.2 in /usr/local/lib/python3.10/dist-packages (from langchain-core<0.2,>=0.1.9->langchain) (23.2)\n", 1832 | "Requirement already satisfied: typing-extensions>=4.2.0 in /usr/local/lib/python3.10/dist-packages (from pydantic<3,>=1->langchain) (4.5.0)\n", 1833 | "Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2->langchain) (3.3.2)\n", 1834 | "Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2->langchain) (3.6)\n", 1835 | "Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2->langchain) (2.0.7)\n", 1836 | "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests<3,>=2->langchain) (2023.11.17)\n", 1837 | "Requirement already satisfied: greenlet!=0.4.17 in /usr/local/lib/python3.10/dist-packages (from SQLAlchemy<3,>=1.4->langchain) (3.0.3)\n", 1838 | "Requirement already satisfied: sniffio>=1.1 in /usr/local/lib/python3.10/dist-packages (from anyio<5,>=3->langchain-core<0.2,>=0.1.9->langchain) (1.3.0)\n", 1839 | "Requirement already satisfied: exceptiongroup in /usr/local/lib/python3.10/dist-packages (from anyio<5,>=3->langchain-core<0.2,>=0.1.9->langchain) (1.2.0)\n", 1840 | "Collecting mypy-extensions>=0.3.0 (from typing-inspect<1,>=0.4.0->dataclasses-json<0.7,>=0.5.7->langchain)\n", 1841 | " Downloading mypy_extensions-1.0.0-py3-none-any.whl (4.7 kB)\n", 1842 | "Installing collected packages: mypy-extensions, marshmallow, jsonpointer, typing-inspect, langsmith, jsonpatch, langchain-core, dataclasses-json, langchain-community, langchain\n", 1843 | "Successfully installed dataclasses-json-0.6.3 jsonpatch-1.33 jsonpointer-2.4 langchain-0.1.1 langchain-community-0.0.13 langchain-core-0.1.13 langsmith-0.0.83 marshmallow-3.20.2 mypy-extensions-1.0.0 typing-inspect-0.9.0\n" 1844 | ] 1845 | } 1846 | ] 1847 | }, 1848 | { 1849 | "cell_type": "code", 1850 | "source": [ 1851 | "import os\n", 1852 | "import torch\n", 1853 | "from datasets import load_dataset\n", 1854 | "from transformers import (\n", 1855 | " AutoModelForCausalLM,\n", 1856 | " AutoTokenizer,\n", 1857 | " BitsAndBytesConfig,\n", 1858 | " HfArgumentParser,\n", 1859 | " TrainingArguments,\n", 1860 | " pipeline,\n", 1861 | " logging,\n", 1862 | ")\n", 1863 | "from peft import LoraConfig, PeftModel\n", 1864 | "from trl import SFTTrainer" 1865 | ], 1866 | "metadata": { 1867 | "id": "nAMzy_0FtaUZ" 1868 | }, 1869 | "execution_count": 1, 1870 | "outputs": [] 1871 | }, 1872 | { 1873 | "cell_type": "code", 1874 | "source": [ 1875 | "# !pip install wandb\n", 1876 | "\n", 1877 | "import wandb\n", 1878 | "wandb.login(key='974d9e7cd3cdd3295f7f3feda090d9949444d26e')" 1879 | ], 1880 | "metadata": { 1881 | "colab": { 1882 | "base_uri": "https://localhost:8080/" 1883 | }, 1884 | "id": "2KscBQKCD2rj", 1885 | "outputId": "989725d3-6aea-425f-a508-31145393500f" 1886 | }, 1887 | "execution_count": 2, 1888 | "outputs": [ 1889 | { 1890 | "output_type": "stream", 1891 | "name": "stderr", 1892 | "text": [ 1893 | "\u001b[34m\u001b[1mwandb\u001b[0m: Currently logged in as: \u001b[33mtensorgirl\u001b[0m. Use \u001b[1m`wandb login --relogin`\u001b[0m to force relogin\n", 1894 | "\u001b[34m\u001b[1mwandb\u001b[0m: \u001b[33mWARNING\u001b[0m If you're specifying your api key in code, ensure this code is not shared publicly.\n", 1895 | "\u001b[34m\u001b[1mwandb\u001b[0m: \u001b[33mWARNING\u001b[0m Consider setting the WANDB_API_KEY environment variable, or running `wandb login` from the command line.\n", 1896 | "\u001b[34m\u001b[1mwandb\u001b[0m: Appending key for api.wandb.ai to your netrc file: /root/.netrc\n" 1897 | ] 1898 | }, 1899 | { 1900 | "output_type": "execute_result", 1901 | "data": { 1902 | "text/plain": [ 1903 | "True" 1904 | ] 1905 | }, 1906 | "metadata": {}, 1907 | "execution_count": 2 1908 | } 1909 | ] 1910 | }, 1911 | { 1912 | "cell_type": "code", 1913 | "source": [ 1914 | "# The model that you want to train from the Hugging Face hub\n", 1915 | "model_name = \"codellama/CodeLlama-7b-Python-hf\"\n", 1916 | "\n", 1917 | "# The instruction dataset to use\n", 1918 | "dataset_name = \"lucasmccabe-lmi/CodeAlpaca-20k\"\n", 1919 | "\n", 1920 | "# Fine-tuned model name\n", 1921 | "new_model = \"Opt-350m-Python-Coding\"\n", 1922 | "\n", 1923 | "################################################################################\n", 1924 | "# QLoRA parameters\n", 1925 | "################################################################################\n", 1926 | "\n", 1927 | "# LoRA attention dimension\n", 1928 | "lora_r = 64\n", 1929 | "\n", 1930 | "# Alpha parameter for LoRA scaling\n", 1931 | "lora_alpha = 16\n", 1932 | "\n", 1933 | "# Dropout probability for LoRA layers\n", 1934 | "lora_dropout = 0.1\n", 1935 | "\n", 1936 | "################################################################################\n", 1937 | "# bitsandbytes parameters\n", 1938 | "################################################################################\n", 1939 | "\n", 1940 | "# Activate 4-bit precision base model loading\n", 1941 | "use_4bit = True\n", 1942 | "\n", 1943 | "# Compute dtype for 4-bit base models\n", 1944 | "bnb_4bit_compute_dtype = \"float16\"\n", 1945 | "\n", 1946 | "# Quantization type (fp4 or nf4)\n", 1947 | "bnb_4bit_quant_type = \"nf4\"\n", 1948 | "\n", 1949 | "# Activate nested quantization for 4-bit base models (double quantization)\n", 1950 | "use_nested_quant = False\n", 1951 | "\n", 1952 | "################################################################################\n", 1953 | "# TrainingArguments parameters\n", 1954 | "################################################################################\n", 1955 | "\n", 1956 | "# Output directory where the model predictions and checkpoints will be stored\n", 1957 | "output_dir = \"./results\"\n", 1958 | "\n", 1959 | "# Number of training epochs\n", 1960 | "num_train_epochs = 1\n", 1961 | "\n", 1962 | "# Enable fp16/bf16 training (set bf16 to True with an A100)\n", 1963 | "fp16 = False\n", 1964 | "bf16 = False\n", 1965 | "\n", 1966 | "# Batch size per GPU for training\n", 1967 | "per_device_train_batch_size = 4\n", 1968 | "\n", 1969 | "# Batch size per GPU for evaluation\n", 1970 | "per_device_eval_batch_size = 4\n", 1971 | "\n", 1972 | "# Number of update steps to accumulate the gradients for\n", 1973 | "gradient_accumulation_steps = 1\n", 1974 | "\n", 1975 | "# Enable gradient checkpointing\n", 1976 | "gradient_checkpointing = True\n", 1977 | "\n", 1978 | "# Maximum gradient normal (gradient clipping)\n", 1979 | "max_grad_norm = 0.3\n", 1980 | "\n", 1981 | "# Initial learning rate (AdamW optimizer)\n", 1982 | "learning_rate = 2e-4\n", 1983 | "\n", 1984 | "# Weight decay to apply to all layers except bias/LayerNorm weights\n", 1985 | "weight_decay = 0.001\n", 1986 | "\n", 1987 | "# Optimizer to use\n", 1988 | "optim = \"paged_adamw_32bit\"\n", 1989 | "\n", 1990 | "# Learning rate schedule\n", 1991 | "lr_scheduler_type = \"cosine\"\n", 1992 | "\n", 1993 | "# Number of training steps (overrides num_train_epochs)\n", 1994 | "max_steps = -1\n", 1995 | "\n", 1996 | "# Ratio of steps for a linear warmup (from 0 to learning rate)\n", 1997 | "warmup_ratio = 0.03\n", 1998 | "\n", 1999 | "# Group sequences into batches with same length\n", 2000 | "# Saves memory and speeds up training considerably\n", 2001 | "group_by_length = True\n", 2002 | "\n", 2003 | "# Save checkpoint every X updates steps\n", 2004 | "save_steps = 0\n", 2005 | "\n", 2006 | "# Log every X updates steps\n", 2007 | "logging_steps = 25\n", 2008 | "\n", 2009 | "################################################################################\n", 2010 | "# SFT parameters\n", 2011 | "################################################################################\n", 2012 | "\n", 2013 | "# Maximum sequence length to use\n", 2014 | "max_seq_length = None\n", 2015 | "\n", 2016 | "# Pack multiple short examples in the same input sequence to increase efficiency\n", 2017 | "packing = False\n", 2018 | "\n", 2019 | "# Load the entire model on the GPU 0\n", 2020 | "device_map = {\"\": 0}" 2021 | ], 2022 | "metadata": { 2023 | "id": "ib_We3NLtj2E" 2024 | }, 2025 | "execution_count": 3, 2026 | "outputs": [] 2027 | }, 2028 | { 2029 | "cell_type": "code", 2030 | "source": [ 2031 | "from trl import SFTTrainer, DataCollatorForCompletionOnlyLM\n", 2032 | "from transformers import CodeLlamaTokenizerFast\n", 2033 | "# Load dataset (you can process it here)\n", 2034 | "os.environ[\"WANDB_PROJECT\"] = \"PythonCodeGenerator\" # name your W&B project\n", 2035 | "os.environ[\"WANDB_LOG_MODEL\"] = \"checkpoint\" # log all model checkpoints\n", 2036 | "\n", 2037 | "dataset = load_dataset(dataset_name, split=\"train\")\n", 2038 | "\n", 2039 | "# Load tokenizer and model with QLoRA configuration\n", 2040 | "compute_dtype = getattr(torch, bnb_4bit_compute_dtype)\n", 2041 | "\n", 2042 | "bnb_config = BitsAndBytesConfig(\n", 2043 | " load_in_4bit=use_4bit,\n", 2044 | " bnb_4bit_quant_type=bnb_4bit_quant_type,\n", 2045 | " bnb_4bit_compute_dtype=compute_dtype,\n", 2046 | " bnb_4bit_use_double_quant=use_nested_quant,\n", 2047 | ")\n", 2048 | "\n", 2049 | "# Check GPU compatibility with bfloat16\n", 2050 | "if compute_dtype == torch.float16 and use_4bit:\n", 2051 | " major, _ = torch.cuda.get_device_capability()\n", 2052 | " if major >= 8:\n", 2053 | " print(\"=\" * 80)\n", 2054 | " print(\"Your GPU supports bfloat16: accelerate training with bf16=True\")\n", 2055 | " print(\"=\" * 80)\n", 2056 | "\n", 2057 | "# Load base model\n", 2058 | "model = AutoModelForCausalLM.from_pretrained(\n", 2059 | " model_name,\n", 2060 | " quantization_config=bnb_config,\n", 2061 | " device_map=device_map\n", 2062 | ")\n", 2063 | "model.config.use_cache = False\n", 2064 | "model.config.pretraining_tp = 1\n", 2065 | "\n", 2066 | "# Load LLaMA tokenizer\n", 2067 | "tokenizer = CodeLlamaTokenizerFast.from_pretrained(\"hf-internal-testing/llama-tokenizer\")\n", 2068 | "tokenizer.pad_token = tokenizer.eos_token\n", 2069 | "tokenizer.padding_side = \"right\" # Fix weird overflow issue with fp16 training\n", 2070 | "\n", 2071 | "# Load LoRA configuration\n", 2072 | "# peft_config = LoraConfig(\n", 2073 | "# lora_alpha=lora_alpha,\n", 2074 | "# lora_dropout=lora_dropout,\n", 2075 | "# r=lora_r,\n", 2076 | "# bias=\"none\",\n", 2077 | "# task_type=\"CAUSAL_LM\",\n", 2078 | "# )\n", 2079 | "\n", 2080 | "# # Set training parameters\n", 2081 | "# training_arguments = TrainingArguments(\n", 2082 | "# output_dir=output_dir,\n", 2083 | "# num_train_epochs=num_train_epochs,\n", 2084 | "# per_device_train_batch_size=per_device_train_batch_size,\n", 2085 | "# gradient_accumulation_steps=gradient_accumulation_steps,\n", 2086 | "# optim=optim,\n", 2087 | "# save_steps=save_steps,\n", 2088 | "# logging_steps=logging_steps,\n", 2089 | "# learning_rate=learning_rate,\n", 2090 | "# weight_decay=weight_decay,\n", 2091 | "# fp16=fp16,\n", 2092 | "# bf16=bf16,\n", 2093 | "# max_grad_norm=max_grad_norm,\n", 2094 | "# max_steps=max_steps,\n", 2095 | "# warmup_ratio=warmup_ratio,\n", 2096 | "# group_by_length=group_by_length,\n", 2097 | "# lr_scheduler_type=lr_scheduler_type,\n", 2098 | "# report_to=\"wandb\"\n", 2099 | "# )\n", 2100 | "\n", 2101 | "# def formatting_prompts_func(example):\n", 2102 | "# output_texts = []\n", 2103 | "# for i in range(len(example['instruction'])):\n", 2104 | "# text = f\"### Question: {example['instruction'][i]}\\n ### Answer: {example['output'][i]}\"\n", 2105 | "# output_texts.append(text)\n", 2106 | "# return output_texts\n", 2107 | "\n", 2108 | "# response_template = \"\\n ### Answer:\"\n", 2109 | "# collator = DataCollatorForCompletionOnlyLM(response_template, tokenizer=tokenizer)\n", 2110 | "\n", 2111 | "\n", 2112 | "# # Set supervised fine-tuning parameters\n", 2113 | "# trainer = SFTTrainer(\n", 2114 | "# model=model,\n", 2115 | "# train_dataset=dataset,\n", 2116 | "# peft_config=peft_config,\n", 2117 | "# formatting_func=formatting_prompts_func,\n", 2118 | "# data_collator=collator,\n", 2119 | "# args=training_arguments,\n", 2120 | "# packing=False,\n", 2121 | "# )\n", 2122 | "\n", 2123 | "# # Train model\n", 2124 | "# trainer.train()\n", 2125 | "\n", 2126 | "# # Save trained model\n", 2127 | "# trainer.model.save_pretrained(new_model)" 2128 | ], 2129 | "metadata": { 2130 | "id": "OJXpOgBFuSrc", 2131 | "colab": { 2132 | "base_uri": "https://localhost:8080/", 2133 | "height": 353, 2134 | "referenced_widgets": [ 2135 | "bcba83c8879042418a9394f9c7f81679", 2136 | "a8800aed719f4c8984347d345c790494", 2137 | "082b115d8c2942668f895730b48afe13", 2138 | "1931804d191c4e68b437313911d62d62", 2139 | "da117453b266461f9cdd0a7e37ecee23", 2140 | "bc2e808c538e4b3790a020c334160753", 2141 | "1a454f10f9384fcc8b6be65ae431f952", 2142 | "77060e0cee3c468f8f9ef3dd4b3fa2cc", 2143 | "ae787850f79f4668818b38aea2296112", 2144 | "6722d10d7c7144f3aa16140e10ce9ad3", 2145 | "e9de96c18d0e45e5b32ce0d90043ce42", 2146 | "2dc0247a47cd4337b56d4907457ccbba", 2147 | "c388ec8854994a50939a31817b006e5d", 2148 | "cfbb0fb9e6a04001941051b5dc27f503", 2149 | "2d42cdca79e443a19e9997c1fb88474c", 2150 | "c39c8d93c1044612a43fd35a7bc476cc", 2151 | "d6d65150405345298f68e3646d4c5539", 2152 | "ebe12af3475d4158a42cd9bf48fb53b2", 2153 | "5a2a2f0e6cd2403b964748b7cd174654", 2154 | "0f1d935b3e224a5a8b996225591f6572", 2155 | "7028fe65757742dfa6d58f8185625696", 2156 | "5b5a09a9585240768ee2c52e06462db8", 2157 | "237d9229c76e4c58b00b99ee61f2dfc5", 2158 | "9608a14f557b4149b4be726e006d39f3", 2159 | "d9de4b042ec047eb8a048c994bb76eff", 2160 | "d6385fe772274448bfa741ac8bb298a5", 2161 | "fe12816ac70f4a5b86893e6883d21eda", 2162 | "2c71165f278849c2aa847926822bb823", 2163 | "b18951dbb1664171a89af76153057c27", 2164 | "ab78d6871bae4d64a57dc9efb7355029", 2165 | "a2393815e27f4db39dbda0370776e15f", 2166 | "1adba38a840848cb92a153dc70db1956", 2167 | "f59e4c4874f946bfb506109b99518f97", 2168 | "901239b3ed93485fa862e00c1b3f6ef7", 2169 | "5db218a9d1a74059b19cbd1afaa7e486", 2170 | "aa81cf4e5c394d87aa5b984cf4886966", 2171 | "85e46d06d139496689d24c49d1c2d26d", 2172 | "314684e0aa4145f7a6253b427c314af1", 2173 | "7054b0f06dc84f6196c2c2b4b51b7f6f", 2174 | "5f3ec1a8f9c54f2ca09fa252d92e8ddf", 2175 | "126bff20f4b04fb5a4238f661d8f0310", 2176 | "930733b0823a4c96bf76c5896f5e985b", 2177 | "0f44af97fc504ae69202511e6feff072", 2178 | "1e2fa67cf7d248c692f4d67e7cda5846", 2179 | "3981ee8e5431479b8fa611575c8d4139", 2180 | "99e44b3765dd4b19a099cee200a5b39d", 2181 | "d9567248d700429686d61a51da356e81", 2182 | "47ef1b7e6146477ca34a576413062eee", 2183 | "dec2ff397e2e426fb70032f90a452022", 2184 | "38e9d04fc5ff479fa8ac1f29585f5b28", 2185 | "03550f7e37d84bff9077d53d69f70658", 2186 | "713b31e14f8245c488a5e24b22cdccde", 2187 | "87226a52d88e4cfe9ad88046e4112270", 2188 | "865ddc435e7f4e37b924107554a5b4de", 2189 | "de796d7ef73d4937917879592769dbf2" 2190 | ] 2191 | }, 2192 | "outputId": "9309b6e7-1cbe-46dc-af6d-a2d65fdc7031" 2193 | }, 2194 | "execution_count": 4, 2195 | "outputs": [ 2196 | { 2197 | "output_type": "stream", 2198 | "name": "stderr", 2199 | "text": [ 2200 | "/usr/local/lib/python3.10/dist-packages/huggingface_hub/utils/_token.py:88: UserWarning: \n", 2201 | "The secret `HF_TOKEN` does not exist in your Colab secrets.\n", 2202 | "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", 2203 | "You will be able to reuse this secret in all of your notebooks.\n", 2204 | "Please note that authentication is recommended but still optional to access public models or datasets.\n", 2205 | " warnings.warn(\n" 2206 | ] 2207 | }, 2208 | { 2209 | "output_type": "display_data", 2210 | "data": { 2211 | "text/plain": [ 2212 | "Loading checkpoint shards: 0%| | 0/2 [00:00[INST] {prompt} [/INST]\")\n", 2309 | "print(result[0]['generated_text'])" 2310 | ], 2311 | "metadata": { 2312 | "id": "frlSLPin4IJ4", 2313 | "colab": { 2314 | "base_uri": "https://localhost:8080/" 2315 | }, 2316 | "outputId": "a617b68d-6f62-4146-bff6-a5cd8b699e78" 2317 | }, 2318 | "execution_count": 5, 2319 | "outputs": [ 2320 | { 2321 | "output_type": "stream", 2322 | "name": "stderr", 2323 | "text": [ 2324 | "/usr/local/lib/python3.10/dist-packages/transformers/generation/utils.py:1518: UserWarning: You have modified the pretrained model configuration to control generation. This is a deprecated strategy to control generation and will be removed soon, in a future version. Please use and modify the model generation configuration (see https://huggingface.co/docs/transformers/generation_strategies#default-text-generation-configuration )\n", 2325 | " warnings.warn(\n" 2326 | ] 2327 | }, 2328 | { 2329 | "output_type": "stream", 2330 | "name": "stdout", 2331 | "text": [ 2332 | "[INST] Create a function that takes a specific input and produces a specific output using any mathematical operators. Write corresponding code in Python. [/INST]\n", 2333 | "\n", 2334 | "# Write a Python function to find the sum of all the numbers in a list.\n", 2335 | "\n", 2336 | "def sum_list(nums):\n", 2337 | " total = 0\n", 2338 | " for num in nums:\n", 2339 | " total += num\n", 2340 | " return total\n", 2341 | "\n", 2342 | "print(sum_list([1, 2, 3, 4, 5]))\n", 2343 | "\n", 2344 | "# Write a Python function to find the product of all the numbers in a list.\n", 2345 | "\n", 2346 | "def prod_list(nums):\n", 2347 | " total = 1\n", 2348 | " for num in nums:\n", 2349 | " total *= num\n", 2350 | " return total\n", 2351 | "\n", 2352 | "print(prod_list([1, 2, 3, 4, 5]))\n", 2353 | "\n", 2354 | "# Write a Python function to find the average of all the numbers in a list.\n" 2355 | ] 2356 | } 2357 | ] 2358 | }, 2359 | { 2360 | "cell_type": "code", 2361 | "source": [ 2362 | "from langchain_community.llms.huggingface_pipeline import HuggingFacePipeline\n", 2363 | "from langchain.callbacks import wandb_tracing_enabled\n", 2364 | "os.environ[\"LANGCHAIN_WANDB_TRACING\"] = \"True\"\n", 2365 | "os.environ[\"WANDB_PROJECT\"] = \"PythonCodeGenerator\"\n", 2366 | "hf = HuggingFacePipeline(pipeline=pipe)\n", 2367 | "\n", 2368 | "from langchain.prompts import PromptTemplate\n", 2369 | "\n", 2370 | "template = \"\"\"Create a function according to the following input. Write corresponding code in Python.\n", 2371 | " {question}\n", 2372 | "\n", 2373 | "Answer: Here is the code\"\"\"\n", 2374 | "prompt = PromptTemplate.from_template(template)\n", 2375 | "\n", 2376 | "chain = prompt | hf\n", 2377 | "\n", 2378 | "question = \"write the code to solve a quadratic equation\"\n", 2379 | "\n", 2380 | "print(chain.invoke({\"question\": question}))" 2381 | ], 2382 | "metadata": { 2383 | "colab": { 2384 | "base_uri": "https://localhost:8080/" 2385 | }, 2386 | "id": "gFKHIEIapTsf", 2387 | "outputId": "14249f72-3a5a-4d14-9392-cad411aa856f" 2388 | }, 2389 | "execution_count": 15, 2390 | "outputs": [ 2391 | { 2392 | "output_type": "stream", 2393 | "name": "stdout", 2394 | "text": [ 2395 | " for quadratic equation.\n", 2396 | "\n", 2397 | "\\begin{code}\n", 2398 | "import math\n", 2399 | "\n", 2400 | "a = float(input(\"Enter a: \"))\n", 2401 | "b = float(input(\"Enter b: \"))\n", 2402 | "c = float(input(\"Enter c: \"))\n", 2403 | "\n", 2404 | "d = b**2 - 4*a*c\n", 2405 | "\n", 2406 | "if d > 0:\n", 2407 | " x1 = (-b + math.sqrt(d)) / (2*a)\n", 2408 | " x2 = (-b - math.sqrt(d)) / (2*a)\n", 2409 | " print(\"The roots are\", x1, \"and\", x2)\n", 2410 | "elif d == 0:\n", 2411 | " x = -b / (2*a)\n", 2412 | " print(\"The root is\", x)\n", 2413 | "else:\n", 2414 | " print(\"The equation\n" 2415 | ] 2416 | } 2417 | ] 2418 | }, 2419 | { 2420 | "cell_type": "code", 2421 | "source": [], 2422 | "metadata": { 2423 | "id": "SiIzPyhmvvqJ" 2424 | }, 2425 | "execution_count": null, 2426 | "outputs": [] 2427 | } 2428 | ] 2429 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CodingAssistant_QLoRA_LLMs 2 | Building a Coding Assistant using LangChain and CodeLlama with QLoRA 3 | 4 | Code generation has become a pivotal tool for boosting productivity and efficiency. One of the latest advancements in this domain is the use of Large Language Models (LLMs) for code generation. These models, such as OpenAI's GPT-3, have demonstrated remarkable capabilities in understanding and generating human-like text, making them a revolutionary force in the world of programming. In this tutorial, we'll explore the fascinating realm of code generation using LLMs and delve into the potential they hold for streamlining development processes 5 | --------------------------------------------------------------------------------