File size: 123,113 Bytes
b74771e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 |
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"gpuType": "L4"
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
},
"accelerator": "GPU"
},
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "qaj9T-0yEQPd",
"outputId": "4638c732-b689-4f7d-c125-cecb80b77452"
},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Cloning into 'ai-edge-torch'...\n",
"remote: Enumerating objects: 6174, done.\u001b[K\n",
"remote: Counting objects: 100% (707/707), done.\u001b[K\n",
"remote: Compressing objects: 100% (194/194), done.\u001b[K\n",
"remote: Total 6174 (delta 613), reused 525 (delta 512), pack-reused 5467 (from 1)\u001b[K\n",
"Receiving objects: 100% (6174/6174), 11.90 MiB | 18.41 MiB/s, done.\n",
"Resolving deltas: 100% (4430/4430), done.\n"
]
}
],
"source": [
"!git clone https://github.com/google-ai-edge/ai-edge-torch.git"
]
},
{
"cell_type": "code",
"source": [
"!pip install tensorflow==2.19.0"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "oPOsX9qaEktY",
"outputId": "23765ef6-513e-45a7-f08e-1309aa682264"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Collecting tensorflow==2.19.0\n",
" Downloading tensorflow-2.19.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.1 kB)\n",
"Requirement already satisfied: absl-py>=1.0.0 in /usr/local/lib/python3.11/dist-packages (from tensorflow==2.19.0) (1.4.0)\n",
"Requirement already satisfied: astunparse>=1.6.0 in /usr/local/lib/python3.11/dist-packages (from tensorflow==2.19.0) (1.6.3)\n",
"Requirement already satisfied: flatbuffers>=24.3.25 in /usr/local/lib/python3.11/dist-packages (from tensorflow==2.19.0) (25.2.10)\n",
"Requirement already satisfied: gast!=0.5.0,!=0.5.1,!=0.5.2,>=0.2.1 in /usr/local/lib/python3.11/dist-packages (from tensorflow==2.19.0) (0.6.0)\n",
"Requirement already satisfied: google-pasta>=0.1.1 in /usr/local/lib/python3.11/dist-packages (from tensorflow==2.19.0) (0.2.0)\n",
"Requirement already satisfied: libclang>=13.0.0 in /usr/local/lib/python3.11/dist-packages (from tensorflow==2.19.0) (18.1.1)\n",
"Requirement already satisfied: opt-einsum>=2.3.2 in /usr/local/lib/python3.11/dist-packages (from tensorflow==2.19.0) (3.4.0)\n",
"Requirement already satisfied: packaging in /usr/local/lib/python3.11/dist-packages (from tensorflow==2.19.0) (24.2)\n",
"Requirement already satisfied: protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<6.0.0dev,>=3.20.3 in /usr/local/lib/python3.11/dist-packages (from tensorflow==2.19.0) (5.29.5)\n",
"Requirement already satisfied: requests<3,>=2.21.0 in /usr/local/lib/python3.11/dist-packages (from tensorflow==2.19.0) (2.32.3)\n",
"Requirement already satisfied: setuptools in /usr/local/lib/python3.11/dist-packages (from tensorflow==2.19.0) (75.2.0)\n",
"Requirement already satisfied: six>=1.12.0 in /usr/local/lib/python3.11/dist-packages (from tensorflow==2.19.0) (1.17.0)\n",
"Requirement already satisfied: termcolor>=1.1.0 in /usr/local/lib/python3.11/dist-packages (from tensorflow==2.19.0) (3.1.0)\n",
"Requirement already satisfied: typing-extensions>=3.6.6 in /usr/local/lib/python3.11/dist-packages (from tensorflow==2.19.0) (4.14.1)\n",
"Requirement already satisfied: wrapt>=1.11.0 in /usr/local/lib/python3.11/dist-packages (from tensorflow==2.19.0) (1.17.2)\n",
"Requirement already satisfied: grpcio<2.0,>=1.24.3 in /usr/local/lib/python3.11/dist-packages (from tensorflow==2.19.0) (1.73.1)\n",
"Collecting tensorboard~=2.19.0 (from tensorflow==2.19.0)\n",
" Downloading tensorboard-2.19.0-py3-none-any.whl.metadata (1.8 kB)\n",
"Requirement already satisfied: keras>=3.5.0 in /usr/local/lib/python3.11/dist-packages (from tensorflow==2.19.0) (3.8.0)\n",
"Requirement already satisfied: numpy<2.2.0,>=1.26.0 in /usr/local/lib/python3.11/dist-packages (from tensorflow==2.19.0) (2.0.2)\n",
"Requirement already satisfied: h5py>=3.11.0 in /usr/local/lib/python3.11/dist-packages (from tensorflow==2.19.0) (3.14.0)\n",
"Collecting ml-dtypes<1.0.0,>=0.5.1 (from tensorflow==2.19.0)\n",
" Downloading ml_dtypes-0.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (21 kB)\n",
"Requirement already satisfied: tensorflow-io-gcs-filesystem>=0.23.1 in /usr/local/lib/python3.11/dist-packages (from tensorflow==2.19.0) (0.37.1)\n",
"Requirement already satisfied: wheel<1.0,>=0.23.0 in /usr/local/lib/python3.11/dist-packages (from astunparse>=1.6.0->tensorflow==2.19.0) (0.45.1)\n",
"Requirement already satisfied: rich in /usr/local/lib/python3.11/dist-packages (from keras>=3.5.0->tensorflow==2.19.0) (13.9.4)\n",
"Requirement already satisfied: namex in /usr/local/lib/python3.11/dist-packages (from keras>=3.5.0->tensorflow==2.19.0) (0.1.0)\n",
"Requirement already satisfied: optree in /usr/local/lib/python3.11/dist-packages (from keras>=3.5.0->tensorflow==2.19.0) (0.16.0)\n",
"Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/dist-packages (from requests<3,>=2.21.0->tensorflow==2.19.0) (3.4.2)\n",
"Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.11/dist-packages (from requests<3,>=2.21.0->tensorflow==2.19.0) (3.10)\n",
"Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/dist-packages (from requests<3,>=2.21.0->tensorflow==2.19.0) (2.4.0)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/dist-packages (from requests<3,>=2.21.0->tensorflow==2.19.0) (2025.6.15)\n",
"Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.11/dist-packages (from tensorboard~=2.19.0->tensorflow==2.19.0) (3.8.2)\n",
"Requirement already satisfied: tensorboard-data-server<0.8.0,>=0.7.0 in /usr/local/lib/python3.11/dist-packages (from tensorboard~=2.19.0->tensorflow==2.19.0) (0.7.2)\n",
"Requirement already satisfied: werkzeug>=1.0.1 in /usr/local/lib/python3.11/dist-packages (from tensorboard~=2.19.0->tensorflow==2.19.0) (3.1.3)\n",
"Requirement already satisfied: MarkupSafe>=2.1.1 in /usr/local/lib/python3.11/dist-packages (from werkzeug>=1.0.1->tensorboard~=2.19.0->tensorflow==2.19.0) (3.0.2)\n",
"Requirement already satisfied: markdown-it-py>=2.2.0 in /usr/local/lib/python3.11/dist-packages (from rich->keras>=3.5.0->tensorflow==2.19.0) (3.0.0)\n",
"Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /usr/local/lib/python3.11/dist-packages (from rich->keras>=3.5.0->tensorflow==2.19.0) (2.19.2)\n",
"Requirement already satisfied: mdurl~=0.1 in /usr/local/lib/python3.11/dist-packages (from markdown-it-py>=2.2.0->rich->keras>=3.5.0->tensorflow==2.19.0) (0.1.2)\n",
"Downloading tensorflow-2.19.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (644.9 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m644.9/644.9 MB\u001b[0m \u001b[31m1.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hDownloading ml_dtypes-0.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.7 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m4.7/4.7 MB\u001b[0m \u001b[31m119.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hDownloading tensorboard-2.19.0-py3-none-any.whl (5.5 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.5/5.5 MB\u001b[0m \u001b[31m130.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hInstalling collected packages: ml-dtypes, tensorboard, tensorflow\n",
" Attempting uninstall: ml-dtypes\n",
" Found existing installation: ml-dtypes 0.4.1\n",
" Uninstalling ml-dtypes-0.4.1:\n",
" Successfully uninstalled ml-dtypes-0.4.1\n",
" Attempting uninstall: tensorboard\n",
" Found existing installation: tensorboard 2.18.0\n",
" Uninstalling tensorboard-2.18.0:\n",
" Successfully uninstalled tensorboard-2.18.0\n",
" Attempting uninstall: tensorflow\n",
" Found existing installation: tensorflow 2.18.0\n",
" Uninstalling tensorflow-2.18.0:\n",
" Successfully uninstalled tensorflow-2.18.0\n",
"\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n",
"tf-keras 2.18.0 requires tensorflow<2.19,>=2.18, but you have tensorflow 2.19.0 which is incompatible.\n",
"tensorflow-text 2.18.1 requires tensorflow<2.19,>=2.18.0, but you have tensorflow 2.19.0 which is incompatible.\n",
"tensorflow-decision-forests 1.11.0 requires tensorflow==2.18.0, but you have tensorflow 2.19.0 which is incompatible.\u001b[0m\u001b[31m\n",
"\u001b[0mSuccessfully installed ml-dtypes-0.5.1 tensorboard-2.19.0 tensorflow-2.19.0\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"!pip list"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "_VMnnza5EnKy",
"outputId": "b43b5a94-d51a-4984-e82f-e6426e1338d0"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Package Version\n",
"------------------------------------- ------------------\n",
"absl-py 1.4.0\n",
"accelerate 1.8.1\n",
"aiofiles 24.1.0\n",
"aiohappyeyeballs 2.6.1\n",
"aiohttp 3.11.15\n",
"aiosignal 1.4.0\n",
"alabaster 1.0.0\n",
"albucore 0.0.24\n",
"albumentations 2.0.8\n",
"ale-py 0.11.1\n",
"altair 5.5.0\n",
"annotated-types 0.7.0\n",
"antlr4-python3-runtime 4.9.3\n",
"anyio 4.9.0\n",
"argon2-cffi 25.1.0\n",
"argon2-cffi-bindings 21.2.0\n",
"array_record 0.7.2\n",
"arviz 0.21.0\n",
"astropy 7.1.0\n",
"astropy-iers-data 0.2025.7.7.0.39.39\n",
"astunparse 1.6.3\n",
"atpublic 5.1\n",
"attrs 25.3.0\n",
"audioread 3.0.1\n",
"autograd 1.8.0\n",
"babel 2.17.0\n",
"backcall 0.2.0\n",
"backports.tarfile 1.2.0\n",
"beautifulsoup4 4.13.4\n",
"betterproto 2.0.0b6\n",
"bigframes 2.8.0\n",
"bigquery-magics 0.9.0\n",
"bleach 6.2.0\n",
"blinker 1.9.0\n",
"blis 1.3.0\n",
"blobfile 3.0.0\n",
"blosc2 3.5.1\n",
"bokeh 3.7.3\n",
"Bottleneck 1.4.2\n",
"bqplot 0.12.45\n",
"branca 0.8.1\n",
"build 1.2.2.post1\n",
"CacheControl 0.14.3\n",
"cachetools 5.5.2\n",
"catalogue 2.0.10\n",
"certifi 2025.6.15\n",
"cffi 1.17.1\n",
"chardet 5.2.0\n",
"charset-normalizer 3.4.2\n",
"chex 0.1.89\n",
"clarabel 0.11.1\n",
"click 8.2.1\n",
"cloudpathlib 0.21.1\n",
"cloudpickle 3.1.1\n",
"cmake 3.31.6\n",
"cmdstanpy 1.2.5\n",
"colorcet 3.1.0\n",
"colorlover 0.3.0\n",
"colour 0.1.5\n",
"community 1.0.0b1\n",
"confection 0.1.5\n",
"cons 0.4.6\n",
"contourpy 1.3.2\n",
"cramjam 2.10.0\n",
"cryptography 43.0.3\n",
"cuda-python 12.6.2.post1\n",
"cudf-cu12 25.2.1\n",
"cudf-polars-cu12 25.2.2\n",
"cufflinks 0.17.3\n",
"cuml-cu12 25.2.1\n",
"cupy-cuda12x 13.3.0\n",
"curl_cffi 0.11.4\n",
"cuvs-cu12 25.2.1\n",
"cvxopt 1.3.2\n",
"cvxpy 1.6.6\n",
"cycler 0.12.1\n",
"cyipopt 1.5.0\n",
"cymem 2.0.11\n",
"Cython 3.0.12\n",
"dask 2024.12.1\n",
"dask-cuda 25.2.0\n",
"dask-cudf-cu12 25.2.2\n",
"dask-expr 1.1.21\n",
"dataproc-spark-connect 0.8.1\n",
"datascience 0.17.6\n",
"datasets 2.14.4\n",
"db-dtypes 1.4.3\n",
"dbus-python 1.2.18\n",
"debugpy 1.8.0\n",
"decorator 4.4.2\n",
"defusedxml 0.7.1\n",
"diffusers 0.34.0\n",
"dill 0.3.7\n",
"distributed 2024.12.1\n",
"distributed-ucxx-cu12 0.42.0\n",
"distro 1.9.0\n",
"dlib 19.24.6\n",
"dm-tree 0.1.9\n",
"docstring_parser 0.16\n",
"docutils 0.21.2\n",
"dopamine_rl 4.1.2\n",
"duckdb 1.2.2\n",
"earthengine-api 1.5.22\n",
"easydict 1.13\n",
"editdistance 0.8.1\n",
"eerepr 0.1.2\n",
"einops 0.8.1\n",
"en_core_web_sm 3.8.0\n",
"entrypoints 0.4\n",
"et_xmlfile 2.0.0\n",
"etils 1.12.2\n",
"etuples 0.3.9\n",
"Farama-Notifications 0.0.4\n",
"fastai 2.7.19\n",
"fastapi 0.115.14\n",
"fastcore 1.7.29\n",
"fastdownload 0.0.7\n",
"fastjsonschema 2.21.1\n",
"fastprogress 1.0.3\n",
"fastrlock 0.8.3\n",
"ffmpy 0.6.0\n",
"filelock 3.18.0\n",
"firebase-admin 6.9.0\n",
"Flask 3.1.1\n",
"flatbuffers 25.2.10\n",
"flax 0.10.6\n",
"folium 0.19.7\n",
"fonttools 4.58.5\n",
"frozendict 2.4.6\n",
"frozenlist 1.7.0\n",
"fsspec 2025.3.2\n",
"future 1.0.0\n",
"gast 0.6.0\n",
"gcsfs 2025.3.2\n",
"GDAL 3.8.4\n",
"gdown 5.2.0\n",
"geemap 0.35.3\n",
"geocoder 1.38.1\n",
"geographiclib 2.0\n",
"geopandas 1.0.1\n",
"geopy 2.4.1\n",
"gin-config 0.5.0\n",
"gitdb 4.0.12\n",
"GitPython 3.1.44\n",
"glob2 0.7\n",
"google 2.0.3\n",
"google-ai-generativelanguage 0.6.15\n",
"google-api-core 2.25.1\n",
"google-api-python-client 2.175.0\n",
"google-auth 2.38.0\n",
"google-auth-httplib2 0.2.0\n",
"google-auth-oauthlib 1.2.2\n",
"google-cloud-aiplatform 1.101.0\n",
"google-cloud-bigquery 3.34.0\n",
"google-cloud-bigquery-connection 1.18.3\n",
"google-cloud-bigquery-storage 2.32.0\n",
"google-cloud-core 2.4.3\n",
"google-cloud-dataproc 5.21.0\n",
"google-cloud-datastore 2.21.0\n",
"google-cloud-firestore 2.21.0\n",
"google-cloud-functions 1.20.4\n",
"google-cloud-iam 2.19.1\n",
"google-cloud-language 2.17.2\n",
"google-cloud-resource-manager 1.14.2\n",
"google-cloud-spanner 3.55.0\n",
"google-cloud-storage 2.19.0\n",
"google-cloud-translate 3.21.1\n",
"google-colab 1.0.0\n",
"google-crc32c 1.7.1\n",
"google-genai 1.24.0\n",
"google-generativeai 0.8.5\n",
"google-pasta 0.2.0\n",
"google-resumable-media 2.7.2\n",
"googleapis-common-protos 1.70.0\n",
"googledrivedownloader 1.1.0\n",
"gradio 5.31.0\n",
"gradio_client 1.10.1\n",
"graphviz 0.21\n",
"greenlet 3.2.3\n",
"groovy 0.1.2\n",
"grpc-google-iam-v1 0.14.2\n",
"grpc-interceptor 0.15.4\n",
"grpcio 1.73.1\n",
"grpcio-status 1.71.2\n",
"grpclib 0.4.8\n",
"gspread 6.2.1\n",
"gspread-dataframe 4.0.0\n",
"gym 0.25.2\n",
"gym-notices 0.0.8\n",
"gymnasium 1.2.0\n",
"h11 0.16.0\n",
"h2 4.2.0\n",
"h5netcdf 1.6.3\n",
"h5py 3.14.0\n",
"hdbscan 0.8.40\n",
"hf_transfer 0.1.9\n",
"hf-xet 1.1.5\n",
"highspy 1.11.0\n",
"holidays 0.75\n",
"holoviews 1.21.0\n",
"hpack 4.1.0\n",
"html5lib 1.1\n",
"httpcore 1.0.9\n",
"httpimport 1.4.1\n",
"httplib2 0.22.0\n",
"httpx 0.28.1\n",
"huggingface-hub 0.33.2\n",
"humanize 4.12.3\n",
"hyperframe 6.1.0\n",
"hyperopt 0.2.7\n",
"ibis-framework 9.5.0\n",
"idna 3.10\n",
"imageio 2.37.0\n",
"imageio-ffmpeg 0.6.0\n",
"imagesize 1.4.1\n",
"imbalanced-learn 0.13.0\n",
"immutabledict 4.2.1\n",
"importlib_metadata 8.7.0\n",
"importlib_resources 6.5.2\n",
"imutils 0.5.4\n",
"inflect 7.5.0\n",
"iniconfig 2.1.0\n",
"intel-cmplr-lib-ur 2025.2.0\n",
"intel-openmp 2025.2.0\n",
"ipyevents 2.0.2\n",
"ipyfilechooser 0.6.0\n",
"ipykernel 6.17.1\n",
"ipyleaflet 0.20.0\n",
"ipyparallel 8.8.0\n",
"ipython 7.34.0\n",
"ipython-genutils 0.2.0\n",
"ipython-sql 0.5.0\n",
"ipytree 0.2.2\n",
"ipywidgets 7.7.1\n",
"itsdangerous 2.2.0\n",
"jaraco.classes 3.4.0\n",
"jaraco.context 6.0.1\n",
"jaraco.functools 4.2.1\n",
"jax 0.5.2\n",
"jax-cuda12-pjrt 0.5.1\n",
"jax-cuda12-plugin 0.5.1\n",
"jaxlib 0.5.1\n",
"jeepney 0.9.0\n",
"jieba 0.42.1\n",
"Jinja2 3.1.6\n",
"jiter 0.10.0\n",
"joblib 1.5.1\n",
"jsonpatch 1.33\n",
"jsonpickle 4.1.1\n",
"jsonpointer 3.0.0\n",
"jsonschema 4.24.0\n",
"jsonschema-specifications 2025.4.1\n",
"jupyter-client 6.1.12\n",
"jupyter-console 6.1.0\n",
"jupyter_core 5.8.1\n",
"jupyter_kernel_gateway 2.5.2\n",
"jupyter-leaflet 0.20.0\n",
"jupyter-server 1.16.0\n",
"jupyterlab_pygments 0.3.0\n",
"jupyterlab_widgets 3.0.15\n",
"jupytext 1.17.2\n",
"kaggle 1.7.4.5\n",
"kagglehub 0.3.12\n",
"keras 3.8.0\n",
"keras-hub 0.18.1\n",
"keras-nlp 0.18.1\n",
"keyring 25.6.0\n",
"keyrings.google-artifactregistry-auth 1.1.2\n",
"kiwisolver 1.4.8\n",
"langchain 0.3.26\n",
"langchain-core 0.3.68\n",
"langchain-text-splitters 0.3.8\n",
"langcodes 3.5.0\n",
"langsmith 0.4.4\n",
"language_data 1.3.0\n",
"launchpadlib 1.10.16\n",
"lazr.restfulclient 0.14.4\n",
"lazr.uri 1.0.6\n",
"lazy_loader 0.4\n",
"libclang 18.1.1\n",
"libcudf-cu12 25.2.1\n",
"libcugraph-cu12 25.2.0\n",
"libcuml-cu12 25.2.1\n",
"libcuvs-cu12 25.2.1\n",
"libkvikio-cu12 25.2.1\n",
"libpysal 4.13.0\n",
"libraft-cu12 25.2.0\n",
"librosa 0.11.0\n",
"libucx-cu12 1.18.1\n",
"libucxx-cu12 0.42.0\n",
"lightgbm 4.5.0\n",
"linkify-it-py 2.0.3\n",
"llvmlite 0.43.0\n",
"locket 1.0.0\n",
"logical-unification 0.4.6\n",
"lxml 5.4.0\n",
"Mako 1.1.3\n",
"marisa-trie 1.2.1\n",
"Markdown 3.8.2\n",
"markdown-it-py 3.0.0\n",
"MarkupSafe 3.0.2\n",
"matplotlib 3.10.0\n",
"matplotlib-inline 0.1.7\n",
"matplotlib-venn 1.1.2\n",
"mdit-py-plugins 0.4.2\n",
"mdurl 0.1.2\n",
"miniKanren 1.0.3\n",
"missingno 0.5.2\n",
"mistune 3.1.3\n",
"mizani 0.13.5\n",
"mkl 2025.0.1\n",
"ml_dtypes 0.5.1\n",
"mlxtend 0.23.4\n",
"more-itertools 10.7.0\n",
"moviepy 1.0.3\n",
"mpmath 1.3.0\n",
"msgpack 1.1.1\n",
"multidict 6.6.3\n",
"multipledispatch 1.0.0\n",
"multiprocess 0.70.15\n",
"multitasking 0.0.11\n",
"murmurhash 1.0.13\n",
"music21 9.3.0\n",
"namex 0.1.0\n",
"narwhals 1.45.0\n",
"natsort 8.4.0\n",
"nbclassic 1.3.1\n",
"nbclient 0.10.2\n",
"nbconvert 7.16.6\n",
"nbformat 5.10.4\n",
"ndindex 1.10.0\n",
"nest-asyncio 1.6.0\n",
"networkx 3.5\n",
"nibabel 5.3.2\n",
"nltk 3.9.1\n",
"notebook 6.5.7\n",
"notebook_shim 0.2.4\n",
"numba 0.60.0\n",
"numba-cuda 0.2.0\n",
"numexpr 2.11.0\n",
"numpy 2.0.2\n",
"nvidia-cublas-cu12 12.5.3.2\n",
"nvidia-cuda-cupti-cu12 12.5.82\n",
"nvidia-cuda-nvcc-cu12 12.5.82\n",
"nvidia-cuda-nvrtc-cu12 12.5.82\n",
"nvidia-cuda-runtime-cu12 12.5.82\n",
"nvidia-cudnn-cu12 9.3.0.75\n",
"nvidia-cufft-cu12 11.2.3.61\n",
"nvidia-curand-cu12 10.3.6.82\n",
"nvidia-cusolver-cu12 11.6.3.83\n",
"nvidia-cusparse-cu12 12.5.1.3\n",
"nvidia-cusparselt-cu12 0.6.2\n",
"nvidia-ml-py 12.575.51\n",
"nvidia-nccl-cu12 2.21.5\n",
"nvidia-nvcomp-cu12 4.2.0.11\n",
"nvidia-nvjitlink-cu12 12.5.82\n",
"nvidia-nvtx-cu12 12.4.127\n",
"nvtx 0.2.12\n",
"nx-cugraph-cu12 25.2.0\n",
"oauth2client 4.1.3\n",
"oauthlib 3.3.1\n",
"omegaconf 2.3.0\n",
"openai 1.93.0\n",
"opencv-contrib-python 4.11.0.86\n",
"opencv-python 4.11.0.86\n",
"opencv-python-headless 4.12.0.88\n",
"openpyxl 3.1.5\n",
"opt_einsum 3.4.0\n",
"optax 0.2.5\n",
"optree 0.16.0\n",
"orbax-checkpoint 0.11.16\n",
"orjson 3.10.18\n",
"osqp 1.0.4\n",
"packaging 24.2\n",
"pandas 2.2.2\n",
"pandas-datareader 0.10.0\n",
"pandas-gbq 0.29.1\n",
"pandas-stubs 2.2.2.240909\n",
"pandocfilters 1.5.1\n",
"panel 1.7.2\n",
"param 2.2.1\n",
"parso 0.8.4\n",
"parsy 2.1\n",
"partd 1.4.2\n",
"pathlib 1.0.1\n",
"patsy 1.0.1\n",
"peewee 3.18.1\n",
"peft 0.16.0\n",
"pexpect 4.9.0\n",
"pickleshare 0.7.5\n",
"pillow 11.2.1\n",
"pip 24.1.2\n",
"platformdirs 4.3.8\n",
"plotly 5.24.1\n",
"plotnine 0.14.6\n",
"pluggy 1.6.0\n",
"ply 3.11\n",
"polars 1.21.0\n",
"pooch 1.8.2\n",
"portpicker 1.5.2\n",
"preshed 3.0.10\n",
"prettytable 3.16.0\n",
"proglog 0.1.12\n",
"progressbar2 4.5.0\n",
"prometheus_client 0.22.1\n",
"promise 2.3\n",
"prompt_toolkit 3.0.51\n",
"propcache 0.3.2\n",
"prophet 1.1.7\n",
"proto-plus 1.26.1\n",
"protobuf 5.29.5\n",
"psutil 5.9.5\n",
"psycopg2 2.9.10\n",
"ptyprocess 0.7.0\n",
"py-cpuinfo 9.0.0\n",
"py4j 0.10.9.7\n",
"pyarrow 18.1.0\n",
"pyasn1 0.6.1\n",
"pyasn1_modules 0.4.2\n",
"pycairo 1.28.0\n",
"pycocotools 2.0.10\n",
"pycparser 2.22\n",
"pycryptodomex 3.23.0\n",
"pydantic 2.11.7\n",
"pydantic_core 2.33.2\n",
"pydata-google-auth 1.9.1\n",
"pydot 3.0.4\n",
"pydotplus 2.0.2\n",
"PyDrive 1.3.1\n",
"PyDrive2 1.21.3\n",
"pydub 0.25.1\n",
"pyerfa 2.0.1.5\n",
"pygame 2.6.1\n",
"pygit2 1.18.0\n",
"Pygments 2.19.2\n",
"PyGObject 3.42.0\n",
"PyJWT 2.10.1\n",
"pylibcudf-cu12 25.2.1\n",
"pylibcugraph-cu12 25.2.0\n",
"pylibraft-cu12 25.2.0\n",
"pymc 5.23.0\n",
"pymystem3 0.2.0\n",
"pynndescent 0.5.13\n",
"pynvjitlink-cu12 0.7.0\n",
"pynvml 12.0.0\n",
"pyogrio 0.11.0\n",
"pyomo 6.9.2\n",
"PyOpenGL 3.1.9\n",
"pyOpenSSL 24.2.1\n",
"pyparsing 3.2.3\n",
"pyperclip 1.9.0\n",
"pyproj 3.7.1\n",
"pyproject_hooks 1.2.0\n",
"pyshp 2.3.1\n",
"PySocks 1.7.1\n",
"pyspark 3.5.1\n",
"pytensor 2.31.6\n",
"pytest 8.3.5\n",
"python-apt 0.0.0\n",
"python-box 7.3.2\n",
"python-dateutil 2.9.0.post0\n",
"python-louvain 0.16\n",
"python-multipart 0.0.20\n",
"python-slugify 8.0.4\n",
"python-snappy 0.7.3\n",
"python-utils 3.9.1\n",
"pytz 2025.2\n",
"pyviz_comms 3.0.6\n",
"PyWavelets 1.8.0\n",
"PyYAML 6.0.2\n",
"pyzmq 24.0.1\n",
"raft-dask-cu12 25.2.0\n",
"rapids-dask-dependency 25.2.0\n",
"ratelim 0.1.6\n",
"referencing 0.36.2\n",
"regex 2024.11.6\n",
"requests 2.32.3\n",
"requests-oauthlib 2.0.0\n",
"requests-toolbelt 1.0.0\n",
"requirements-parser 0.9.0\n",
"rich 13.9.4\n",
"rmm-cu12 25.2.0\n",
"roman-numerals-py 3.1.0\n",
"rpds-py 0.26.0\n",
"rpy2 3.5.17\n",
"rsa 4.9.1\n",
"ruff 0.12.2\n",
"safehttpx 0.1.6\n",
"safetensors 0.5.3\n",
"scikit-image 0.25.2\n",
"scikit-learn 1.6.1\n",
"scipy 1.15.3\n",
"scooby 0.10.1\n",
"scs 3.2.7.post2\n",
"seaborn 0.13.2\n",
"SecretStorage 3.3.3\n",
"semantic-version 2.10.0\n",
"Send2Trash 1.8.3\n",
"sentence-transformers 4.1.0\n",
"sentencepiece 0.2.0\n",
"sentry-sdk 2.32.0\n",
"setuptools 75.2.0\n",
"shap 0.48.0\n",
"shapely 2.1.1\n",
"shellingham 1.5.4\n",
"simple-parsing 0.1.7\n",
"simplejson 3.20.1\n",
"simsimd 6.4.10\n",
"six 1.17.0\n",
"sklearn-compat 0.1.3\n",
"sklearn-pandas 2.2.0\n",
"slicer 0.0.8\n",
"smart_open 7.3.0.post1\n",
"smmap 5.0.2\n",
"sniffio 1.3.1\n",
"snowballstemmer 3.0.1\n",
"sortedcontainers 2.4.0\n",
"soundfile 0.13.1\n",
"soupsieve 2.7\n",
"soxr 0.5.0.post1\n",
"spacy 3.8.7\n",
"spacy-legacy 3.0.12\n",
"spacy-loggers 1.0.5\n",
"spanner-graph-notebook 1.1.7\n",
"Sphinx 8.2.3\n",
"sphinxcontrib-applehelp 2.0.0\n",
"sphinxcontrib-devhelp 2.0.0\n",
"sphinxcontrib-htmlhelp 2.1.0\n",
"sphinxcontrib-jsmath 1.0.1\n",
"sphinxcontrib-qthelp 2.0.0\n",
"sphinxcontrib-serializinghtml 2.0.0\n",
"SQLAlchemy 2.0.41\n",
"sqlglot 25.20.2\n",
"sqlparse 0.5.3\n",
"srsly 2.5.1\n",
"stanio 0.5.1\n",
"starlette 0.46.2\n",
"statsmodels 0.14.4\n",
"stringzilla 3.12.5\n",
"stumpy 1.13.0\n",
"sympy 1.13.1\n",
"tables 3.10.2\n",
"tabulate 0.9.0\n",
"tbb 2022.2.0\n",
"tblib 3.1.0\n",
"tcmlib 1.4.0\n",
"tenacity 8.5.0\n",
"tensorboard 2.19.0\n",
"tensorboard-data-server 0.7.2\n",
"tensorflow 2.19.0\n",
"tensorflow-datasets 4.9.9\n",
"tensorflow_decision_forests 1.11.0\n",
"tensorflow-hub 0.16.1\n",
"tensorflow-io-gcs-filesystem 0.37.1\n",
"tensorflow-metadata 1.17.2\n",
"tensorflow-probability 0.25.0\n",
"tensorflow-text 2.18.1\n",
"tensorstore 0.1.74\n",
"termcolor 3.1.0\n",
"terminado 0.18.1\n",
"text-unidecode 1.3\n",
"textblob 0.19.0\n",
"tf_keras 2.18.0\n",
"tf-slim 1.1.0\n",
"thinc 8.3.6\n",
"threadpoolctl 3.6.0\n",
"tifffile 2025.6.11\n",
"tiktoken 0.9.0\n",
"timm 1.0.16\n",
"tinycss2 1.4.0\n",
"tokenizers 0.21.2\n",
"toml 0.10.2\n",
"tomlkit 0.13.3\n",
"toolz 0.12.1\n",
"torch 2.6.0+cu124\n",
"torchao 0.10.0\n",
"torchaudio 2.6.0+cu124\n",
"torchdata 0.11.0\n",
"torchsummary 1.5.1\n",
"torchtune 0.6.1\n",
"torchvision 0.21.0+cu124\n",
"tornado 6.4.2\n",
"tqdm 4.67.1\n",
"traitlets 5.7.1\n",
"traittypes 0.2.1\n",
"transformers 4.53.1\n",
"treelite 4.4.1\n",
"treescope 0.1.9\n",
"triton 3.2.0\n",
"tsfresh 0.21.0\n",
"tweepy 4.15.0\n",
"typeguard 4.4.4\n",
"typer 0.16.0\n",
"types-pytz 2025.2.0.20250516\n",
"types-setuptools 80.9.0.20250529\n",
"typing_extensions 4.14.1\n",
"typing-inspection 0.4.1\n",
"tzdata 2025.2\n",
"tzlocal 5.3.1\n",
"uc-micro-py 1.0.3\n",
"ucx-py-cu12 0.42.0\n",
"ucxx-cu12 0.42.0\n",
"umap-learn 0.5.9.post2\n",
"umf 0.11.0\n",
"uritemplate 4.2.0\n",
"urllib3 2.4.0\n",
"uvicorn 0.35.0\n",
"vega-datasets 0.9.0\n",
"wadllib 1.3.6\n",
"wandb 0.21.0\n",
"wasabi 1.1.3\n",
"wcwidth 0.2.13\n",
"weasel 0.4.1\n",
"webcolors 24.11.1\n",
"webencodings 0.5.1\n",
"websocket-client 1.8.0\n",
"websockets 15.0.1\n",
"Werkzeug 3.1.3\n",
"wheel 0.45.1\n",
"widgetsnbextension 3.6.10\n",
"wordcloud 1.9.4\n",
"wrapt 1.17.2\n",
"wurlitzer 3.1.1\n",
"xarray 2025.3.1\n",
"xarray-einstats 0.9.1\n",
"xgboost 2.1.4\n",
"xlrd 2.0.2\n",
"xxhash 3.5.0\n",
"xyzservices 2025.4.0\n",
"yarl 1.20.1\n",
"ydf 0.12.0\n",
"yellowbrick 1.5\n",
"yfinance 0.2.65\n",
"zict 3.0.0\n",
"zipp 3.23.0\n",
"zstandard 0.23.0\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"!pip install torch-xla2\n",
"!pip install ai_edge_quantizer\n",
"!pip install ai_edge_litert #available latest 0.2.1 and 0.1.0"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000
},
"id": "wo7zRFbfEsYT",
"outputId": "1a3acc29-2dce-4bc6-f5af-6494e81bf2b9"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Collecting torch-xla2\n",
" Downloading torch_xla2-0.0.1.dev202412041639-py3-none-any.whl.metadata (2.5 kB)\n",
"Requirement already satisfied: absl-py in /usr/local/lib/python3.11/dist-packages (from torch-xla2) (1.4.0)\n",
"Requirement already satisfied: immutabledict in /usr/local/lib/python3.11/dist-packages (from torch-xla2) (4.2.1)\n",
"Requirement already satisfied: pytest in /usr/local/lib/python3.11/dist-packages (from torch-xla2) (8.3.5)\n",
"Requirement already satisfied: torch>=2.3.0 in /usr/local/lib/python3.11/dist-packages (from torch-xla2) (2.6.0+cu124)\n",
"Requirement already satisfied: filelock in /usr/local/lib/python3.11/dist-packages (from torch>=2.3.0->torch-xla2) (3.18.0)\n",
"Requirement already satisfied: typing-extensions>=4.10.0 in /usr/local/lib/python3.11/dist-packages (from torch>=2.3.0->torch-xla2) (4.14.1)\n",
"Requirement already satisfied: networkx in /usr/local/lib/python3.11/dist-packages (from torch>=2.3.0->torch-xla2) (3.5)\n",
"Requirement already satisfied: jinja2 in /usr/local/lib/python3.11/dist-packages (from torch>=2.3.0->torch-xla2) (3.1.6)\n",
"Requirement already satisfied: fsspec in /usr/local/lib/python3.11/dist-packages (from torch>=2.3.0->torch-xla2) (2025.3.2)\n",
"Collecting nvidia-cuda-nvrtc-cu12==12.4.127 (from torch>=2.3.0->torch-xla2)\n",
" Downloading nvidia_cuda_nvrtc_cu12-12.4.127-py3-none-manylinux2014_x86_64.whl.metadata (1.5 kB)\n",
"Collecting nvidia-cuda-runtime-cu12==12.4.127 (from torch>=2.3.0->torch-xla2)\n",
" Downloading nvidia_cuda_runtime_cu12-12.4.127-py3-none-manylinux2014_x86_64.whl.metadata (1.5 kB)\n",
"Collecting nvidia-cuda-cupti-cu12==12.4.127 (from torch>=2.3.0->torch-xla2)\n",
" Downloading nvidia_cuda_cupti_cu12-12.4.127-py3-none-manylinux2014_x86_64.whl.metadata (1.6 kB)\n",
"Collecting nvidia-cudnn-cu12==9.1.0.70 (from torch>=2.3.0->torch-xla2)\n",
" Downloading nvidia_cudnn_cu12-9.1.0.70-py3-none-manylinux2014_x86_64.whl.metadata (1.6 kB)\n",
"Collecting nvidia-cublas-cu12==12.4.5.8 (from torch>=2.3.0->torch-xla2)\n",
" Downloading nvidia_cublas_cu12-12.4.5.8-py3-none-manylinux2014_x86_64.whl.metadata (1.5 kB)\n",
"Collecting nvidia-cufft-cu12==11.2.1.3 (from torch>=2.3.0->torch-xla2)\n",
" Downloading nvidia_cufft_cu12-11.2.1.3-py3-none-manylinux2014_x86_64.whl.metadata (1.5 kB)\n",
"Collecting nvidia-curand-cu12==10.3.5.147 (from torch>=2.3.0->torch-xla2)\n",
" Downloading nvidia_curand_cu12-10.3.5.147-py3-none-manylinux2014_x86_64.whl.metadata (1.5 kB)\n",
"Collecting nvidia-cusolver-cu12==11.6.1.9 (from torch>=2.3.0->torch-xla2)\n",
" Downloading nvidia_cusolver_cu12-11.6.1.9-py3-none-manylinux2014_x86_64.whl.metadata (1.6 kB)\n",
"Collecting nvidia-cusparse-cu12==12.3.1.170 (from torch>=2.3.0->torch-xla2)\n",
" Downloading nvidia_cusparse_cu12-12.3.1.170-py3-none-manylinux2014_x86_64.whl.metadata (1.6 kB)\n",
"Requirement already satisfied: nvidia-cusparselt-cu12==0.6.2 in /usr/local/lib/python3.11/dist-packages (from torch>=2.3.0->torch-xla2) (0.6.2)\n",
"Requirement already satisfied: nvidia-nccl-cu12==2.21.5 in /usr/local/lib/python3.11/dist-packages (from torch>=2.3.0->torch-xla2) (2.21.5)\n",
"Requirement already satisfied: nvidia-nvtx-cu12==12.4.127 in /usr/local/lib/python3.11/dist-packages (from torch>=2.3.0->torch-xla2) (12.4.127)\n",
"Collecting nvidia-nvjitlink-cu12==12.4.127 (from torch>=2.3.0->torch-xla2)\n",
" Downloading nvidia_nvjitlink_cu12-12.4.127-py3-none-manylinux2014_x86_64.whl.metadata (1.5 kB)\n",
"Requirement already satisfied: triton==3.2.0 in /usr/local/lib/python3.11/dist-packages (from torch>=2.3.0->torch-xla2) (3.2.0)\n",
"Requirement already satisfied: sympy==1.13.1 in /usr/local/lib/python3.11/dist-packages (from torch>=2.3.0->torch-xla2) (1.13.1)\n",
"Requirement already satisfied: mpmath<1.4,>=1.1.0 in /usr/local/lib/python3.11/dist-packages (from sympy==1.13.1->torch>=2.3.0->torch-xla2) (1.3.0)\n",
"Requirement already satisfied: iniconfig in /usr/local/lib/python3.11/dist-packages (from pytest->torch-xla2) (2.1.0)\n",
"Requirement already satisfied: packaging in /usr/local/lib/python3.11/dist-packages (from pytest->torch-xla2) (24.2)\n",
"Requirement already satisfied: pluggy<2,>=1.5 in /usr/local/lib/python3.11/dist-packages (from pytest->torch-xla2) (1.6.0)\n",
"Requirement already satisfied: MarkupSafe>=2.0 in /usr/local/lib/python3.11/dist-packages (from jinja2->torch>=2.3.0->torch-xla2) (3.0.2)\n",
"Downloading torch_xla2-0.0.1.dev202412041639-py3-none-any.whl (76 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m76.7/76.7 kB\u001b[0m \u001b[31m3.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hDownloading nvidia_cublas_cu12-12.4.5.8-py3-none-manylinux2014_x86_64.whl (363.4 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m363.4/363.4 MB\u001b[0m \u001b[31m2.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hDownloading nvidia_cuda_cupti_cu12-12.4.127-py3-none-manylinux2014_x86_64.whl (13.8 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m13.8/13.8 MB\u001b[0m \u001b[31m73.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hDownloading nvidia_cuda_nvrtc_cu12-12.4.127-py3-none-manylinux2014_x86_64.whl (24.6 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m24.6/24.6 MB\u001b[0m \u001b[31m98.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hDownloading nvidia_cuda_runtime_cu12-12.4.127-py3-none-manylinux2014_x86_64.whl (883 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m883.7/883.7 kB\u001b[0m \u001b[31m57.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hDownloading nvidia_cudnn_cu12-9.1.0.70-py3-none-manylinux2014_x86_64.whl (664.8 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m664.8/664.8 MB\u001b[0m \u001b[31m1.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hDownloading nvidia_cufft_cu12-11.2.1.3-py3-none-manylinux2014_x86_64.whl (211.5 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m211.5/211.5 MB\u001b[0m \u001b[31m4.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hDownloading nvidia_curand_cu12-10.3.5.147-py3-none-manylinux2014_x86_64.whl (56.3 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m56.3/56.3 MB\u001b[0m \u001b[31m40.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hDownloading nvidia_cusolver_cu12-11.6.1.9-py3-none-manylinux2014_x86_64.whl (127.9 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m127.9/127.9 MB\u001b[0m \u001b[31m17.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hDownloading nvidia_cusparse_cu12-12.3.1.170-py3-none-manylinux2014_x86_64.whl (207.5 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m207.5/207.5 MB\u001b[0m \u001b[31m3.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hDownloading nvidia_nvjitlink_cu12-12.4.127-py3-none-manylinux2014_x86_64.whl (21.1 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m21.1/21.1 MB\u001b[0m \u001b[31m108.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hInstalling collected packages: nvidia-nvjitlink-cu12, nvidia-curand-cu12, nvidia-cufft-cu12, nvidia-cuda-runtime-cu12, nvidia-cuda-nvrtc-cu12, nvidia-cuda-cupti-cu12, nvidia-cublas-cu12, nvidia-cusparse-cu12, nvidia-cudnn-cu12, nvidia-cusolver-cu12, torch-xla2\n",
" Attempting uninstall: nvidia-nvjitlink-cu12\n",
" Found existing installation: nvidia-nvjitlink-cu12 12.5.82\n",
" Uninstalling nvidia-nvjitlink-cu12-12.5.82:\n",
" Successfully uninstalled nvidia-nvjitlink-cu12-12.5.82\n",
" Attempting uninstall: nvidia-curand-cu12\n",
" Found existing installation: nvidia-curand-cu12 10.3.6.82\n",
" Uninstalling nvidia-curand-cu12-10.3.6.82:\n",
" Successfully uninstalled nvidia-curand-cu12-10.3.6.82\n",
" Attempting uninstall: nvidia-cufft-cu12\n",
" Found existing installation: nvidia-cufft-cu12 11.2.3.61\n",
" Uninstalling nvidia-cufft-cu12-11.2.3.61:\n",
" Successfully uninstalled nvidia-cufft-cu12-11.2.3.61\n",
" Attempting uninstall: nvidia-cuda-runtime-cu12\n",
" Found existing installation: nvidia-cuda-runtime-cu12 12.5.82\n",
" Uninstalling nvidia-cuda-runtime-cu12-12.5.82:\n",
" Successfully uninstalled nvidia-cuda-runtime-cu12-12.5.82\n",
" Attempting uninstall: nvidia-cuda-nvrtc-cu12\n",
" Found existing installation: nvidia-cuda-nvrtc-cu12 12.5.82\n",
" Uninstalling nvidia-cuda-nvrtc-cu12-12.5.82:\n",
" Successfully uninstalled nvidia-cuda-nvrtc-cu12-12.5.82\n",
" Attempting uninstall: nvidia-cuda-cupti-cu12\n",
" Found existing installation: nvidia-cuda-cupti-cu12 12.5.82\n",
" Uninstalling nvidia-cuda-cupti-cu12-12.5.82:\n",
" Successfully uninstalled nvidia-cuda-cupti-cu12-12.5.82\n",
" Attempting uninstall: nvidia-cublas-cu12\n",
" Found existing installation: nvidia-cublas-cu12 12.5.3.2\n",
" Uninstalling nvidia-cublas-cu12-12.5.3.2:\n",
" Successfully uninstalled nvidia-cublas-cu12-12.5.3.2\n",
" Attempting uninstall: nvidia-cusparse-cu12\n",
" Found existing installation: nvidia-cusparse-cu12 12.5.1.3\n",
" Uninstalling nvidia-cusparse-cu12-12.5.1.3:\n",
" Successfully uninstalled nvidia-cusparse-cu12-12.5.1.3\n",
" Attempting uninstall: nvidia-cudnn-cu12\n",
" Found existing installation: nvidia-cudnn-cu12 9.3.0.75\n",
" Uninstalling nvidia-cudnn-cu12-9.3.0.75:\n",
" Successfully uninstalled nvidia-cudnn-cu12-9.3.0.75\n",
" Attempting uninstall: nvidia-cusolver-cu12\n",
" Found existing installation: nvidia-cusolver-cu12 11.6.3.83\n",
" Uninstalling nvidia-cusolver-cu12-11.6.3.83:\n",
" Successfully uninstalled nvidia-cusolver-cu12-11.6.3.83\n",
"Successfully installed nvidia-cublas-cu12-12.4.5.8 nvidia-cuda-cupti-cu12-12.4.127 nvidia-cuda-nvrtc-cu12-12.4.127 nvidia-cuda-runtime-cu12-12.4.127 nvidia-cudnn-cu12-9.1.0.70 nvidia-cufft-cu12-11.2.1.3 nvidia-curand-cu12-10.3.5.147 nvidia-cusolver-cu12-11.6.1.9 nvidia-cusparse-cu12-12.3.1.170 nvidia-nvjitlink-cu12-12.4.127 torch-xla2-0.0.1.dev202412041639\n",
"Collecting ai_edge_quantizer\n",
" Downloading ai_edge_quantizer-0.2.1-py3-none-any.whl.metadata (1.7 kB)\n",
"Requirement already satisfied: immutabledict in /usr/local/lib/python3.11/dist-packages (from ai_edge_quantizer) (4.2.1)\n",
"Requirement already satisfied: numpy in /usr/local/lib/python3.11/dist-packages (from ai_edge_quantizer) (2.0.2)\n",
"Collecting tf-nightly==2.20.0.dev20250515 (from ai_edge_quantizer)\n",
" Downloading tf_nightly-2.20.0.dev20250515-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.3 kB)\n",
"Collecting ai-edge-litert==1.3.0 (from ai_edge_quantizer)\n",
" Downloading ai_edge_litert-1.3.0-cp311-cp311-manylinux_2_17_x86_64.whl.metadata (1.7 kB)\n",
"Collecting backports.strenum (from ai-edge-litert==1.3.0->ai_edge_quantizer)\n",
" Downloading backports_strenum-1.2.8-py3-none-any.whl.metadata (3.6 kB)\n",
"Requirement already satisfied: flatbuffers in /usr/local/lib/python3.11/dist-packages (from ai-edge-litert==1.3.0->ai_edge_quantizer) (25.2.10)\n",
"Requirement already satisfied: tqdm in /usr/local/lib/python3.11/dist-packages (from ai-edge-litert==1.3.0->ai_edge_quantizer) (4.67.1)\n",
"Requirement already satisfied: typing-extensions in /usr/local/lib/python3.11/dist-packages (from ai-edge-litert==1.3.0->ai_edge_quantizer) (4.14.1)\n",
"Requirement already satisfied: absl-py>=1.0.0 in /usr/local/lib/python3.11/dist-packages (from tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (1.4.0)\n",
"Requirement already satisfied: astunparse>=1.6.0 in /usr/local/lib/python3.11/dist-packages (from tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (1.6.3)\n",
"Requirement already satisfied: gast!=0.5.0,!=0.5.1,!=0.5.2,>=0.2.1 in /usr/local/lib/python3.11/dist-packages (from tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (0.6.0)\n",
"Requirement already satisfied: google-pasta>=0.1.1 in /usr/local/lib/python3.11/dist-packages (from tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (0.2.0)\n",
"Requirement already satisfied: libclang>=13.0.0 in /usr/local/lib/python3.11/dist-packages (from tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (18.1.1)\n",
"Requirement already satisfied: opt-einsum>=2.3.2 in /usr/local/lib/python3.11/dist-packages (from tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (3.4.0)\n",
"Requirement already satisfied: packaging in /usr/local/lib/python3.11/dist-packages (from tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (24.2)\n",
"Requirement already satisfied: protobuf>=4.21.6 in /usr/local/lib/python3.11/dist-packages (from tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (5.29.5)\n",
"Requirement already satisfied: requests<3,>=2.21.0 in /usr/local/lib/python3.11/dist-packages (from tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (2.32.3)\n",
"Requirement already satisfied: setuptools in /usr/local/lib/python3.11/dist-packages (from tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (75.2.0)\n",
"Requirement already satisfied: six>=1.12.0 in /usr/local/lib/python3.11/dist-packages (from tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (1.17.0)\n",
"Requirement already satisfied: termcolor>=1.1.0 in /usr/local/lib/python3.11/dist-packages (from tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (3.1.0)\n",
"Requirement already satisfied: wrapt>=1.11.0 in /usr/local/lib/python3.11/dist-packages (from tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (1.17.2)\n",
"Requirement already satisfied: grpcio<2.0,>=1.24.3 in /usr/local/lib/python3.11/dist-packages (from tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (1.73.1)\n",
"Collecting tb-nightly~=2.19.0.a (from tf-nightly==2.20.0.dev20250515->ai_edge_quantizer)\n",
" Downloading tb_nightly-2.19.0a20250218-py3-none-any.whl.metadata (1.8 kB)\n",
"Collecting keras-nightly>=3.6.0.dev (from tf-nightly==2.20.0.dev20250515->ai_edge_quantizer)\n",
" Downloading keras_nightly-3.10.0.dev2025071003-py3-none-any.whl.metadata (6.0 kB)\n",
"Requirement already satisfied: h5py>=3.11.0 in /usr/local/lib/python3.11/dist-packages (from tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (3.14.0)\n",
"Requirement already satisfied: ml-dtypes<1.0.0,>=0.5.1 in /usr/local/lib/python3.11/dist-packages (from tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (0.5.1)\n",
"Requirement already satisfied: wheel<1.0,>=0.23.0 in /usr/local/lib/python3.11/dist-packages (from astunparse>=1.6.0->tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (0.45.1)\n",
"Requirement already satisfied: rich in /usr/local/lib/python3.11/dist-packages (from keras-nightly>=3.6.0.dev->tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (13.9.4)\n",
"Requirement already satisfied: namex in /usr/local/lib/python3.11/dist-packages (from keras-nightly>=3.6.0.dev->tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (0.1.0)\n",
"Requirement already satisfied: optree in /usr/local/lib/python3.11/dist-packages (from keras-nightly>=3.6.0.dev->tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (0.16.0)\n",
"Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/dist-packages (from requests<3,>=2.21.0->tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (3.4.2)\n",
"Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.11/dist-packages (from requests<3,>=2.21.0->tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (3.10)\n",
"Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/dist-packages (from requests<3,>=2.21.0->tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (2.4.0)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/dist-packages (from requests<3,>=2.21.0->tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (2025.6.15)\n",
"Requirement already satisfied: markdown>=2.6.8 in /usr/local/lib/python3.11/dist-packages (from tb-nightly~=2.19.0.a->tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (3.8.2)\n",
"Requirement already satisfied: tensorboard-data-server<0.8.0,>=0.7.0 in /usr/local/lib/python3.11/dist-packages (from tb-nightly~=2.19.0.a->tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (0.7.2)\n",
"Requirement already satisfied: werkzeug>=1.0.1 in /usr/local/lib/python3.11/dist-packages (from tb-nightly~=2.19.0.a->tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (3.1.3)\n",
"Requirement already satisfied: MarkupSafe>=2.1.1 in /usr/local/lib/python3.11/dist-packages (from werkzeug>=1.0.1->tb-nightly~=2.19.0.a->tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (3.0.2)\n",
"Requirement already satisfied: markdown-it-py>=2.2.0 in /usr/local/lib/python3.11/dist-packages (from rich->keras-nightly>=3.6.0.dev->tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (3.0.0)\n",
"Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /usr/local/lib/python3.11/dist-packages (from rich->keras-nightly>=3.6.0.dev->tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (2.19.2)\n",
"Requirement already satisfied: mdurl~=0.1 in /usr/local/lib/python3.11/dist-packages (from markdown-it-py>=2.2.0->rich->keras-nightly>=3.6.0.dev->tf-nightly==2.20.0.dev20250515->ai_edge_quantizer) (0.1.2)\n",
"Downloading ai_edge_quantizer-0.2.1-py3-none-any.whl (186 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m187.0/187.0 kB\u001b[0m \u001b[31m7.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hDownloading ai_edge_litert-1.3.0-cp311-cp311-manylinux_2_17_x86_64.whl (11.2 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m11.2/11.2 MB\u001b[0m \u001b[31m133.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hDownloading tf_nightly-2.20.0.dev20250515-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (601.9 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m601.9/601.9 MB\u001b[0m \u001b[31m2.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hDownloading keras_nightly-3.10.0.dev2025071003-py3-none-any.whl (1.4 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.4/1.4 MB\u001b[0m \u001b[31m75.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hDownloading tb_nightly-2.19.0a20250218-py3-none-any.whl (5.5 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.5/5.5 MB\u001b[0m \u001b[31m77.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hDownloading backports_strenum-1.2.8-py3-none-any.whl (7.9 kB)\n",
"Installing collected packages: backports.strenum, tb-nightly, ai-edge-litert, keras-nightly, tf-nightly, ai_edge_quantizer\n",
"Successfully installed ai-edge-litert-1.3.0 ai_edge_quantizer-0.2.1 backports.strenum-1.2.8 keras-nightly-3.10.0.dev2025071003 tb-nightly-2.19.0a20250218 tf-nightly-2.20.0.dev20250515\n"
]
},
{
"output_type": "display_data",
"data": {
"application/vnd.colab-display-data+json": {
"pip_warning": {
"packages": [
"backports"
]
},
"id": "4899a62535cf4be29758b13e1d87a167"
}
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stdout",
"text": [
"Requirement already satisfied: ai_edge_litert in /usr/local/lib/python3.11/dist-packages (1.3.0)\n",
"Requirement already satisfied: backports.strenum in /usr/local/lib/python3.11/dist-packages (from ai_edge_litert) (1.2.8)\n",
"Requirement already satisfied: flatbuffers in /usr/local/lib/python3.11/dist-packages (from ai_edge_litert) (25.2.10)\n",
"Requirement already satisfied: numpy>=1.23.2 in /usr/local/lib/python3.11/dist-packages (from ai_edge_litert) (2.0.2)\n",
"Requirement already satisfied: tqdm in /usr/local/lib/python3.11/dist-packages (from ai_edge_litert) (4.67.1)\n",
"Requirement already satisfied: typing-extensions in /usr/local/lib/python3.11/dist-packages (from ai_edge_litert) (4.14.1)\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"%cd ai-edge-torch"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "JaK44iZdEvXm",
"outputId": "0764cd12-d15d-4317-c3c4-e4ce8cd04b8a"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"/content/ai-edge-torch\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"!ls"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "_PwAI2vrExjs",
"outputId": "55cd92c0-d024-4166-8b12-e1b47daeec89"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"ai_edge_torch CONTRIBUTING.md\t LICENSE\t run_tests.sh\n",
"bazel\t dev-requirements.txt MODULE.bazel setup.py\n",
"build_config docs\t\t README.md\t test\n",
"ci\t format.sh\t requirements.txt WORKSPACE\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"!pip install -U \"huggingface_hub[cli]\""
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "S8NOGLRqEz42",
"outputId": "1e532c95-6440-4cc0-cd66-131ee5c826a4"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Requirement already satisfied: huggingface_hub[cli] in /usr/local/lib/python3.11/dist-packages (0.33.2)\n",
"Requirement already satisfied: filelock in /usr/local/lib/python3.11/dist-packages (from huggingface_hub[cli]) (3.18.0)\n",
"Requirement already satisfied: fsspec>=2023.5.0 in /usr/local/lib/python3.11/dist-packages (from huggingface_hub[cli]) (2025.3.2)\n",
"Requirement already satisfied: packaging>=20.9 in /usr/local/lib/python3.11/dist-packages (from huggingface_hub[cli]) (24.2)\n",
"Requirement already satisfied: pyyaml>=5.1 in /usr/local/lib/python3.11/dist-packages (from huggingface_hub[cli]) (6.0.2)\n",
"Requirement already satisfied: requests in /usr/local/lib/python3.11/dist-packages (from huggingface_hub[cli]) (2.32.3)\n",
"Requirement already satisfied: tqdm>=4.42.1 in /usr/local/lib/python3.11/dist-packages (from huggingface_hub[cli]) (4.67.1)\n",
"Requirement already satisfied: typing-extensions>=3.7.4.3 in /usr/local/lib/python3.11/dist-packages (from huggingface_hub[cli]) (4.14.1)\n",
"Requirement already satisfied: hf-xet<2.0.0,>=1.1.2 in /usr/local/lib/python3.11/dist-packages (from huggingface_hub[cli]) (1.1.5)\n",
"Collecting InquirerPy==0.3.4 (from huggingface_hub[cli])\n",
" Downloading InquirerPy-0.3.4-py3-none-any.whl.metadata (8.1 kB)\n",
"Collecting pfzy<0.4.0,>=0.3.1 (from InquirerPy==0.3.4->huggingface_hub[cli])\n",
" Downloading pfzy-0.3.4-py3-none-any.whl.metadata (4.9 kB)\n",
"Requirement already satisfied: prompt-toolkit<4.0.0,>=3.0.1 in /usr/local/lib/python3.11/dist-packages (from InquirerPy==0.3.4->huggingface_hub[cli]) (3.0.51)\n",
"Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.11/dist-packages (from requests->huggingface_hub[cli]) (3.4.2)\n",
"Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.11/dist-packages (from requests->huggingface_hub[cli]) (3.10)\n",
"Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.11/dist-packages (from requests->huggingface_hub[cli]) (2.4.0)\n",
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.11/dist-packages (from requests->huggingface_hub[cli]) (2025.6.15)\n",
"Requirement already satisfied: wcwidth in /usr/local/lib/python3.11/dist-packages (from prompt-toolkit<4.0.0,>=3.0.1->InquirerPy==0.3.4->huggingface_hub[cli]) (0.2.13)\n",
"Downloading InquirerPy-0.3.4-py3-none-any.whl (67 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m67.7/67.7 kB\u001b[0m \u001b[31m3.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hDownloading pfzy-0.3.4-py3-none-any.whl (8.5 kB)\n",
"Installing collected packages: pfzy, InquirerPy\n",
"Successfully installed InquirerPy-0.3.4 pfzy-0.3.4\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"from huggingface_hub import login\n",
"from google.colab import userdata\n",
"HF_TOKEN=userdata.get('HF_READ')\n",
"\n",
"if HF_TOKEN:\n",
" login(HF_TOKEN)\n",
" print(\"Successfully logged in to Hugging Face!\")\n",
"else:\n",
" print(\"Token is not set. Please save the token first.\")"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "hVUtajitF_aJ",
"outputId": "d5588d84-649a-49a7-873f-3f64bb4e4515"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Successfully logged in to Hugging Face!\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"!huggingface-cli download MadeAgents/Hammer2.1-0.5b --repo-type model --local-dir ./models/MadeAgents/Hammer2.1-0.5b"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "lMKgeOA1E3a4",
"outputId": "416f50b3-b692-430a-c3dd-2e9bc0c61804"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"\rFetching 13 files: 0% 0/13 [00:00<?, ?it/s]Downloading 'model.safetensors' to 'models/MadeAgents/Hammer2.1-0.5b/.cache/huggingface/download/xGOKKLRSlIhH692hSVvI1-gpoa8=.506f5ecd5c55a2a6f5874e29a30c0d4273ec7c3e19f02554e4ff5573c1526489.incomplete'\n",
"Downloading 'special_tokens_map.json' to 'models/MadeAgents/Hammer2.1-0.5b/.cache/huggingface/download/ahkChHUJFxEmOdq5GDFEmerRzCY=.ac23c0aaa2434523c494330aeb79c58395378103.incomplete'\n",
"Downloading 'merges.txt' to 'models/MadeAgents/Hammer2.1-0.5b/.cache/huggingface/download/PtHk0z_I45atnj23IIRhTExwT3w=.31349551d90c7606f325fe0f11bbb8bd5fa0d7c7.incomplete'\n",
"Downloading '.gitattributes' to 'models/MadeAgents/Hammer2.1-0.5b/.cache/huggingface/download/wPaCkH-WbT7GsmxMKKrNZTV4nSM=.52373fe24473b1aa44333d318f578ae6bf04b49b.incomplete'\n",
"Downloading 'added_tokens.json' to 'models/MadeAgents/Hammer2.1-0.5b/.cache/huggingface/download/SeqzFlf9ZNZ3or_wZAOIdsM3Yxw=.482ced4679301bf287ebb310bdd1790eb4514232.incomplete'\n",
"Downloading 'README.md' to 'models/MadeAgents/Hammer2.1-0.5b/.cache/huggingface/download/Xn7B-BWUGOee2Y6hCZtEhtFu4BE=.3a96c6faaeafaae026a2e36df43973b27b8548b0.incomplete'\n",
"Downloading 'config.json' to 'models/MadeAgents/Hammer2.1-0.5b/.cache/huggingface/download/8_PA_wEVGiVa2goH2H4KQOQpvVY=.444277f8ece6653d41cae124d44d1d8ab9533ff4.incomplete'\n",
"Downloading 'generation_config.json' to 'models/MadeAgents/Hammer2.1-0.5b/.cache/huggingface/download/3EVKVggOldJcKSsGjSdoUCN1AyQ=.f237e177090c2bd0bf2ec1c81a894fc1f864dec6.incomplete'\n",
"\n",
"special_tokens_map.json: 100% 613/613 [00:00<00:00, 5.69MB/s]\n",
"Download complete. Moving file to models/MadeAgents/Hammer2.1-0.5b/special_tokens_map.json\n",
"\n",
"merges.txt: 0.00B [00:00, ?B/s]\u001b[A\n",
"\n",
".gitattributes: 1.57kB [00:00, 10.6MB/s]\n",
"Download complete. Moving file to models/MadeAgents/Hammer2.1-0.5b/.gitattributes\n",
"Fetching 13 files: 8% 1/13 [00:00<00:04, 2.71it/s]\n",
"\n",
"added_tokens.json: 100% 605/605 [00:00<00:00, 6.03MB/s]\n",
"Download complete. Moving file to models/MadeAgents/Hammer2.1-0.5b/added_tokens.json\n",
"\n",
"\n",
"README.md: 11.1kB [00:00, 41.9MB/s]\n",
"Download complete. Moving file to models/MadeAgents/Hammer2.1-0.5b/README.md\n",
"\n",
"\n",
"config.json: 100% 912/912 [00:00<00:00, 9.99MB/s]\n",
"Download complete. Moving file to models/MadeAgents/Hammer2.1-0.5b/config.json\n",
"\n",
"\n",
"generation_config.json: 100% 243/243 [00:00<00:00, 2.80MB/s]\n",
"Download complete. Moving file to models/MadeAgents/Hammer2.1-0.5b/generation_config.json\n",
"\n",
"merges.txt: 1.13MB [00:00, 11.3MB/s]\u001b[ADownloading 'tokenizer.json' to 'models/MadeAgents/Hammer2.1-0.5b/.cache/huggingface/download/HgM_lKo9sdSCfRtVg7MMFS7EKqo=.9c5ae00e602b8860cbd784ba82a8aa14e8feecec692e7076590d014d7b7fdafa.incomplete'\n",
"\n",
"\n",
"merges.txt: 1.67MB [00:00, 12.1MB/s]\n",
"Download complete. Moving file to models/MadeAgents/Hammer2.1-0.5b/merges.txt\n",
"Fetching 13 files: 46% 6/13 [00:00<00:00, 14.44it/s]Downloading 'v2_figures/bfcl.png' to 'models/MadeAgents/Hammer2.1-0.5b/.cache/huggingface/download/v2_figures/ubtM4iKa9HECyl7n7mp8gJUAG1Y=.a0e9cdd56f024adfea1701d165e26bcda80989a9.incomplete'\n",
"Downloading 'tokenizer_config.json' to 'models/MadeAgents/Hammer2.1-0.5b/.cache/huggingface/download/vzaExXFZNBay89bvlQv-ZcI6BTg=.f0106388b564d9a8b4a2e5c756463d22b844dddf.incomplete'\n",
"Downloading 'v2_figures/others-v2.png' to 'models/MadeAgents/Hammer2.1-0.5b/.cache/huggingface/download/v2_figures/j2GVbtX7IRIsnAzNNqkJovHiN70=.57c6cb3abaa5c1501bf026e6ed051a364aec6b1b.incomplete'\n",
"Downloading 'vocab.json' to 'models/MadeAgents/Hammer2.1-0.5b/.cache/huggingface/download/j3m-Hy6QvBddw8RXA1uSWl1AJ0c=.4783fe10ac3adce15ac8f358ef5462739852c569.incomplete'\n",
"\n",
"\n",
"model.safetensors: 1% 10.5M/988M [00:00<00:13, 73.6MB/s]\u001b[A\u001b[A\n",
"tokenizer_config.json: 7.13kB [00:00, 23.6MB/s]\n",
"Download complete. Moving file to models/MadeAgents/Hammer2.1-0.5b/tokenizer_config.json\n",
"\n",
"others-v2.png: 0% 0.00/122k [00:00<?, ?B/s]\u001b[A\n",
"\n",
"\n",
"bfcl.png: 0% 0.00/315k [00:00<?, ?B/s]\u001b[A\u001b[A\u001b[A\n",
"\n",
"\n",
"\n",
"others-v2.png: 100% 122k/122k [00:00<00:00, 6.20MB/s]\n",
"Download complete. Moving file to models/MadeAgents/Hammer2.1-0.5b/v2_figures/others-v2.png\n",
"\n",
"bfcl.png: 100% 315k/315k [00:00<00:00, 8.86MB/s]\n",
"Download complete. Moving file to models/MadeAgents/Hammer2.1-0.5b/v2_figures/bfcl.png\n",
"\n",
"\n",
"model.safetensors: 2% 21.0M/988M [00:00<00:12, 76.3MB/s]\u001b[A\u001b[A\n",
"vocab.json: 1.18MB [00:00, 11.7MB/s]\u001b[A\n",
"\n",
"\n",
"\n",
"tokenizer.json: 100% 11.4M/11.4M [00:00<00:00, 73.6MB/s]\n",
"Download complete. Moving file to models/MadeAgents/Hammer2.1-0.5b/tokenizer.json\n",
"\n",
"\n",
"model.safetensors: 3% 31.5M/988M [00:00<00:12, 78.2MB/s]\u001b[A\u001b[A\n",
"vocab.json: 2.78MB [00:00, 12.2MB/s]\n",
"Download complete. Moving file to models/MadeAgents/Hammer2.1-0.5b/vocab.json\n",
"\n",
"\n",
"model.safetensors: 4% 41.9M/988M [00:00<00:11, 79.3MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 5% 52.4M/988M [00:00<00:11, 79.8MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 6% 62.9M/988M [00:00<00:11, 79.6MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 7% 73.4M/988M [00:00<00:11, 79.4MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 8% 83.9M/988M [00:01<00:11, 79.3MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 10% 94.4M/988M [00:01<00:11, 79.2MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 11% 105M/988M [00:01<00:11, 79.0MB/s] \u001b[A\u001b[A\n",
"\n",
"model.safetensors: 12% 115M/988M [00:01<00:11, 77.5MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 13% 126M/988M [00:01<00:11, 76.4MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 14% 136M/988M [00:01<00:11, 77.1MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 15% 147M/988M [00:01<00:10, 77.7MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 16% 157M/988M [00:02<00:10, 78.2MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 17% 168M/988M [00:02<00:10, 78.5MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 18% 178M/988M [00:02<00:10, 78.8MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 19% 189M/988M [00:02<00:10, 78.9MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 20% 199M/988M [00:02<00:09, 78.9MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 21% 210M/988M [00:02<00:09, 79.0MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 22% 220M/988M [00:02<00:09, 79.0MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 23% 231M/988M [00:02<00:09, 79.3MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 24% 241M/988M [00:03<00:09, 79.4MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 25% 252M/988M [00:03<00:09, 79.3MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 27% 262M/988M [00:03<00:09, 79.2MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 28% 273M/988M [00:03<00:09, 79.0MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 29% 283M/988M [00:03<00:08, 79.2MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 30% 294M/988M [00:03<00:08, 78.5MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 31% 304M/988M [00:03<00:08, 78.2MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 32% 315M/988M [00:04<00:08, 78.2MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 33% 325M/988M [00:04<00:08, 77.8MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 34% 336M/988M [00:04<00:08, 77.6MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 35% 346M/988M [00:04<00:08, 77.6MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 36% 357M/988M [00:04<00:08, 77.5MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 37% 367M/988M [00:04<00:08, 77.5MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 38% 377M/988M [00:04<00:07, 77.9MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 39% 388M/988M [00:04<00:07, 78.2MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 40% 398M/988M [00:05<00:07, 78.3MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 41% 409M/988M [00:05<00:07, 78.5MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 42% 419M/988M [00:05<00:07, 78.8MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 44% 430M/988M [00:05<00:07, 78.8MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 45% 440M/988M [00:05<00:06, 78.6MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 46% 451M/988M [00:05<00:06, 78.6MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 47% 461M/988M [00:05<00:06, 78.8MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 48% 472M/988M [00:06<00:06, 78.7MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 49% 482M/988M [00:06<00:06, 78.7MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 50% 493M/988M [00:06<00:06, 78.4MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 51% 503M/988M [00:06<00:06, 78.1MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 52% 514M/988M [00:06<00:06, 78.3MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 53% 524M/988M [00:06<00:05, 78.5MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 54% 535M/988M [00:06<00:05, 78.5MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 55% 545M/988M [00:06<00:05, 78.5MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 56% 556M/988M [00:07<00:05, 78.7MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 57% 566M/988M [00:07<00:05, 78.4MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 58% 577M/988M [00:07<00:05, 78.3MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 59% 587M/988M [00:07<00:05, 78.6MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 61% 598M/988M [00:07<00:04, 78.5MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 62% 608M/988M [00:07<00:04, 78.8MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 63% 619M/988M [00:07<00:04, 79.0MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 64% 629M/988M [00:08<00:04, 78.9MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 65% 640M/988M [00:08<00:04, 79.0MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 66% 650M/988M [00:08<00:04, 78.9MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 67% 661M/988M [00:08<00:04, 78.8MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 68% 671M/988M [00:08<00:04, 78.4MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 69% 682M/988M [00:08<00:03, 78.6MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 70% 692M/988M [00:08<00:03, 78.7MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 71% 703M/988M [00:08<00:03, 78.5MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 72% 713M/988M [00:09<00:03, 78.1MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 73% 724M/988M [00:09<00:03, 78.1MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 74% 734M/988M [00:09<00:03, 78.3MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 75% 744M/988M [00:09<00:03, 78.4MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 76% 755M/988M [00:09<00:02, 78.1MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 78% 765M/988M [00:09<00:02, 78.2MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 79% 776M/988M [00:09<00:02, 78.2MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 80% 786M/988M [00:10<00:02, 78.2MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 81% 797M/988M [00:10<00:02, 78.1MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 82% 807M/988M [00:10<00:02, 78.1MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 83% 818M/988M [00:10<00:02, 78.2MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 84% 828M/988M [00:10<00:02, 77.8MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 85% 839M/988M [00:10<00:01, 78.1MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 86% 849M/988M [00:10<00:01, 78.1MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 87% 860M/988M [00:10<00:01, 78.2MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 88% 870M/988M [00:11<00:01, 78.3MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 89% 881M/988M [00:11<00:01, 78.1MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 90% 891M/988M [00:11<00:01, 78.3MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 91% 902M/988M [00:11<00:01, 78.4MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 92% 912M/988M [00:11<00:00, 78.5MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 93% 923M/988M [00:11<00:00, 78.6MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 94% 933M/988M [00:11<00:00, 78.7MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 96% 944M/988M [00:12<00:00, 78.6MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 97% 954M/988M [00:12<00:00, 78.5MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 98% 965M/988M [00:12<00:00, 78.5MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 99% 975M/988M [00:12<00:00, 78.7MB/s]\u001b[A\u001b[A\n",
"\n",
"model.safetensors: 100% 988M/988M [00:12<00:00, 78.5MB/s]\n",
"Download complete. Moving file to models/MadeAgents/Hammer2.1-0.5b/model.safetensors\n",
"Fetching 13 files: 100% 13/13 [00:13<00:00, 1.01s/it]\n",
"/content/ai-edge-torch/models/MadeAgents/Hammer2.1-0.5b\n"
]
}
]
},
{
"cell_type": "code",
"source": [],
"metadata": {
"id": "PSJV7grr40YQ"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"Change file convert_to_tflite.py\n",
"\n",
"Go to line 28 and change 1.5b -> 0.5b"
],
"metadata": {
"id": "DrXtVp_K1ZDv"
}
},
{
"cell_type": "code",
"source": [],
"metadata": {
"id": "ED0CDmjS41Pi"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"# For CPU inference in android, use dynamic_int8\n",
"# For GPU inference no set up is found to successful load in android GPU\n",
"NONE = 'none'\n",
"DYNAMIC_INT8 = 'dynamic_int8'\n",
"WEIGHT_ONLY_INT8 = 'weight_only_int8'\n",
"FP16 = 'fp16'\n",
"DYNAMIC_INT4_BLOCK32 = 'dynamic_int4_block32'\n",
"DYNAMIC_INT4_BLOCK128 = 'dynamic_int4_block128'\n",
"\n",
"!python -m ai_edge_torch.generative.examples.hammer.convert_to_tflite \\\n",
" --quantize=\"dynamic_int8\" \\\n",
" --checkpoint_path=/content/ai-edge-torch/models/MadeAgents/Hammer2.1-0.5b \\\n",
" --output_path=\"/content/ai-edge-torch\" \\\n",
" --prefill_seq_lens=128 \\\n",
" --kv_cache_max_len=1280 \\\n",
" --mask_as_input \\\n",
" --transpose_kv_cache \\\n",
" --model_size=0.5b \\\n",
" --undefok=model_size"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 906
},
"id": "iZkgWLKsHUbu",
"outputId": "f9ae1947-cb7b-4e65-b2c7-2c54348064f2"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"2025-07-10 06:50:41.687029: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.\n",
"2025-07-10 06:50:41.759915: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.\n",
"To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.\n",
"/usr/local/lib/python3.11/dist-packages/torch/distributed/distributed_c10d.py:354: UserWarning: Device capability of jax unspecified, assuming `cpu` and `cuda`. Please specify it via the `devices` argument of `register_backend`.\n",
" warnings.warn(\n",
"I0710 06:52:12.594704 134034596196992 _jax_lowerings.py:32] Use JAX lowering: aten.view\n",
"I0710 06:52:12.625253 134034596196992 _jax_lowerings.py:32] Use JAX lowering: aten.embedding\n",
"I0710 06:52:12.652188 134034596196992 _jax_lowerings.py:32] Use JAX lowering: aten.arange.start_step\n",
"I0710 06:52:12.657038 134034596196992 _jax_lowerings.py:32] Use JAX lowering: aten.mul.Tensor\n",
"I0710 06:52:12.662169 134034596196992 _jax_lowerings.py:32] Use JAX lowering: aten.pow\n",
"I0710 06:52:12.669392 134034596196992 _jax_lowerings.py:32] Use JAX lowering: aten.clone.default\n",
"I0710 06:52:12.673428 134034596196992 _jax_lowerings.py:32] Use JAX lowering: aten.unsqueeze.default\n",
"I0710 06:52:12.690506 134034596196992 _jax_lowerings.py:32] Use JAX lowering: aten.div\n",
"I0710 06:52:12.695722 134034596196992 _jax_lowerings.py:32] Use JAX lowering: aten.cos\n",
"I0710 06:52:12.700235 134034596196992 _jax_lowerings.py:32] Use JAX lowering: aten.sin\n",
"I0710 06:52:12.704801 134034596196992 _jax_lowerings.py:32] Use JAX lowering: aten.full\n",
"I0710 06:52:12.714902 134034596196992 _jax_lowerings.py:32] Use JAX lowering: aten.mean\n",
"I0710 06:52:12.721963 134034596196992 _jax_lowerings.py:32] Use JAX lowering: aten.add.Tensor\n",
"I0710 06:52:12.727718 134034596196992 _jax_lowerings.py:32] Use JAX lowering: aten.rsqrt\n",
"I0710 06:52:12.752371 134034596196992 _jax_lowerings.py:32] Use JAX lowering: aten.permute\n",
"I0710 06:52:12.756566 134034596196992 _jax_lowerings.py:32] Use JAX lowering: aten.mm\n",
"I0710 06:52:12.794465 134034596196992 _jax_lowerings.py:32] Use JAX lowering: aten.split_with_sizes\n",
"I0710 06:52:12.841455 134034596196992 _jax_lowerings.py:32] Use JAX lowering: aten.sub.Tensor\n",
"I0710 06:52:12.941104 134034596196992 _jax_lowerings.py:32] Use JAX lowering: aten.select\n",
"I0710 06:52:13.022526 134034596196992 _jax_lowerings.py:32] Use JAX lowering: aten._softmax\n",
"I0710 06:52:13.125936 134034596196992 _jax_lowerings.py:32] Use JAX lowering: aten.sigmoid\n",
"2025-07-10 06:52:45.497092: W tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:47] Overriding orig_value setting because the TF_FORCE_GPU_ALLOW_GROWTH environment variable is set. Original config value was 0.\n",
"WARNING: All log messages before absl::InitializeLog() is called are written to STDERR\n",
"I0000 00:00:1752130365.497227 2680 gpu_device.cc:2018] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 20961 MB memory: -> device: 0, name: NVIDIA L4, pci bus id: 0000:00:03.0, compute capability: 8.9\n",
"I0710 06:52:48.273987 134034596196992 signature_serialization.py:156] Function `inner` contains input name(s) resource with unsupported characters which will be renamed to xlacallmodule_readvariableop_192_resource in the SavedModel.\n",
"I0710 06:52:48.417292 134034596196992 signature_serialization.py:156] Function `inner` contains input name(s) resource with unsupported characters which will be renamed to xlacallmodule_readvariableop_193_resource in the SavedModel.\n",
"I0710 06:52:50.194184 134034596196992 functional_saver.py:440] Sharding callback duration: 145 microseconds\n",
"I0710 06:52:52.274698 134034596196992 functional_saver.py:440] Sharding callback duration: 129 microseconds\n",
"INFO:tensorflow:Assets written to: /tmp/tmpwltrmz55/assets\n",
"I0710 06:52:57.939098 134034596196992 builder_impl.py:836] Assets written to: /tmp/tmpwltrmz55/assets\n",
"I0710 06:52:57.947176 134034596196992 fingerprinting_utils.py:49] Writing fingerprint to /tmp/tmpwltrmz55/fingerprint.pb\n",
"W0000 00:00:1752130383.092105 2680 tf_tfl_flatbuffer_helpers.cc:364] Ignored output_format.\n",
"W0000 00:00:1752130383.092143 2680 tf_tfl_flatbuffer_helpers.cc:367] Ignored drop_control_dependency.\n",
"2025-07-10 06:53:03.093113: I tensorflow/cc/saved_model/reader.cc:83] Reading SavedModel from: /tmp/tmpwltrmz55\n",
"2025-07-10 06:53:03.102923: I tensorflow/cc/saved_model/reader.cc:52] Reading meta graph with tags { serve }\n",
"2025-07-10 06:53:03.102950: I tensorflow/cc/saved_model/reader.cc:147] Reading SavedModel debug info (if present) from: /tmp/tmpwltrmz55\n",
"I0000 00:00:1752130383.166955 2680 mlir_graph_optimization_pass.cc:437] MLIR V1 optimization pass is not enabled\n",
"2025-07-10 06:53:03.176475: I tensorflow/cc/saved_model/loader.cc:236] Restoring SavedModel bundle.\n",
"2025-07-10 06:53:04.416172: I tensorflow/cc/saved_model/loader.cc:220] Running initialization op on SavedModel bundle at path: /tmp/tmpwltrmz55\n",
"2025-07-10 06:53:04.542634: I tensorflow/cc/saved_model/loader.cc:471] SavedModel load for tags { serve }; Status: success: OK. Took 1449520 microseconds.\n",
"2025-07-10 06:53:04.654622: I tensorflow/compiler/mlir/tensorflow/utils/dump_mlir_util.cc:269] disabling MLIR crash reproducer, set env var `MLIR_CRASH_REPRODUCER_DIRECTORY` to enable.\n",
"2025-07-10 06:55:05.854247: I tensorflow/compiler/mlir/lite/flatbuffer_export.cc:4096] Estimated count of arithmetic ops: 93.485 G ops, equivalently 46.743 G MACs\n"
]
},
{
"output_type": "execute_result",
"data": {
"text/plain": [
"'\\nblaze run //third_party/py/ai_edge_torch/generative/examples/hammer:convert_to_tflite -- \\n --checkpoint_path /tmp/snapshots/MadeAgents/Hammer2.1-1.5b \\n --output_path /tmp/tmps7np6qhp \\n --output_name_prefix Hammer2.1-1.5b_seq128 \\n --kv_cache_max_len 1280 \\n --mask_as_input \\n --transpose_kv_cache\\n --model_size 1.5b \\n --undefok=model_size \\n --quantize dynamic_int8 \\n --prefill_seq_lens 128\\n'"
],
"application/vnd.google.colaboratory.intrinsic+json": {
"type": "string"
}
},
"metadata": {},
"execution_count": 6
}
]
},
{
"cell_type": "code",
"source": [
"%cd ai_edge_torch/generative/tools\n",
"\n",
"!python tokenizer_to_sentencepiece.py \\\n",
" --checkpoint=MadeAgents/Hammer2.1-0.5b \\\n",
" --output_path=/content/tokenizer.model"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "sRvr3KXIHuwO",
"outputId": "2a25018b-34cb-492b-a6f3-eff1e05d24a7"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"/content/ai-edge-torch/ai_edge_torch/generative/tools\n",
"I0710 06:57:41.739611 137180622922368 utils.py:164] NumExpr defaulting to 12 threads.\n",
"tokenizer_config.json: 7.13kB [00:00, 23.0MB/s]\n",
"vocab.json: 2.78MB [00:00, 48.8MB/s]\n",
"merges.txt: 1.67MB [00:00, 127MB/s]\n",
"tokenizer.json: 100% 11.4M/11.4M [00:00<00:00, 128MB/s]\n",
"added_tokens.json: 100% 605/605 [00:00<00:00, 3.52MB/s]\n",
"special_tokens_map.json: 100% 613/613 [00:00<00:00, 4.64MB/s]\n",
"I0710 06:57:44.359609 137180622922368 tokenizer_to_sentencepiece.py:299] vocab_file does not exist. Try to build a new one.\n",
"I0710 06:57:53.229321 137180622922368 tokenizer_to_sentencepiece.py:183] Found pad_id: 151643, pad_piece: <|endoftext|>\n",
"I0710 06:57:53.229638 137180622922368 tokenizer_to_sentencepiece.py:179] Found eos_id: 151645, eos_piece: <|im_end|>\n",
"I0710 06:57:53.230827 137180622922368 tokenizer_to_sentencepiece.py:204] number of tokens: 151665\n",
"I0710 06:57:53.231059 137180622922368 tokenizer_to_sentencepiece.py:206] number of NORMAL: 150144\n",
"I0710 06:57:53.231109 137180622922368 tokenizer_to_sentencepiece.py:206] number of UNUSED: 1499\n",
"I0710 06:57:53.231164 137180622922368 tokenizer_to_sentencepiece.py:206] number of UNKNOWN: 1\n",
"I0710 06:57:53.231228 137180622922368 tokenizer_to_sentencepiece.py:206] number of USER_DEFINED: 21\n",
"I0710 06:57:53.352619 137180622922368 tokenizer_to_sentencepiece.py:257] String to verify: Hello, world! How are you?\n",
"I0710 06:57:53.352900 137180622922368 tokenizer_to_sentencepiece.py:258] Token IDs by the oringal tokenizer: [9707, 11, 1879, 0, 2585, 525, 498, 30]\n",
"I0710 06:57:53.352944 137180622922368 tokenizer_to_sentencepiece.py:259] Token IDs by the SentencePiece tokenizer: [9707, 11, 1879, 0, 2585, 525, 498, 30]\n",
"I0710 06:57:53.352984 137180622922368 tokenizer_to_sentencepiece.py:261] PASS\n",
"I0710 06:57:53.353320 137180622922368 tokenizer_to_sentencepiece.py:257] String to verify: Instruct: write a python program to add 2 and 3.\n",
"I0710 06:57:53.353379 137180622922368 tokenizer_to_sentencepiece.py:258] Token IDs by the oringal tokenizer: [641, 1235, 25, 3270, 264, 10135, 2025, 311, 912, 220, 17, 323, 220, 18, 13]\n",
"I0710 06:57:53.353415 137180622922368 tokenizer_to_sentencepiece.py:259] Token IDs by the SentencePiece tokenizer: [641, 1235, 25, 3270, 264, 10135, 2025, 311, 912, 220, 17, 323, 220, 18, 13]\n",
"I0710 06:57:53.353448 137180622922368 tokenizer_to_sentencepiece.py:261] PASS\n",
"I0710 06:58:04.615295 137180622922368 tokenizer_to_sentencepiece.py:225] Not matched strictly 3/100 pairs: 3.00%, loosely 0/100 pairs: 0.00%\n",
"I0710 06:58:16.108360 137180622922368 tokenizer_to_sentencepiece.py:225] Not matched strictly 6/200 pairs: 3.00%, loosely 0/200 pairs: 0.00%\n",
"I0710 06:58:27.580932 137180622922368 tokenizer_to_sentencepiece.py:225] Not matched strictly 8/300 pairs: 2.67%, loosely 0/300 pairs: 0.00%\n",
"I0710 06:58:39.014399 137180622922368 tokenizer_to_sentencepiece.py:225] Not matched strictly 13/400 pairs: 3.25%, loosely 0/400 pairs: 0.00%\n",
"I0710 06:58:50.537630 137180622922368 tokenizer_to_sentencepiece.py:225] Not matched strictly 19/500 pairs: 3.80%, loosely 0/500 pairs: 0.00%\n",
"I0710 06:59:01.968418 137180622922368 tokenizer_to_sentencepiece.py:225] Not matched strictly 22/600 pairs: 3.67%, loosely 0/600 pairs: 0.00%\n",
"I0710 06:59:13.855856 137180622922368 tokenizer_to_sentencepiece.py:225] Not matched strictly 30/700 pairs: 4.29%, loosely 0/700 pairs: 0.00%\n",
"I0710 06:59:24.913957 137180622922368 tokenizer_to_sentencepiece.py:225] Not matched strictly 35/800 pairs: 4.38%, loosely 0/800 pairs: 0.00%\n",
"I0710 06:59:35.834920 137180622922368 tokenizer_to_sentencepiece.py:225] Not matched strictly 40/900 pairs: 4.44%, loosely 0/900 pairs: 0.00%\n",
"I0710 06:59:46.792476 137180622922368 tokenizer_to_sentencepiece.py:225] Not matched strictly 46/1000 pairs: 4.60%, loosely 0/1000 pairs: 0.00%\n",
"I0710 06:59:46.792602 137180622922368 tokenizer_to_sentencepiece.py:225] Not matched strictly 46/1000 pairs: 4.60%, loosely 0/1000 pairs: 0.00%\n",
"I0710 06:59:46.792666 137180622922368 tokenizer_to_sentencepiece.py:307] Writing the SentencePieceModel protobuf file to: /content/tokenizer.model\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"!pip install mediapipe"
],
"metadata": {
"id": "QiyP70vCH6bw",
"colab": {
"base_uri": "https://localhost:8080/",
"height": 1000
},
"outputId": "ab29eb7e-4b19-4f02-9831-42355ab1f2d1"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"Collecting mediapipe\n",
" Downloading mediapipe-0.10.21-cp311-cp311-manylinux_2_28_x86_64.whl.metadata (9.7 kB)\n",
"Requirement already satisfied: absl-py in /usr/local/lib/python3.11/dist-packages (from mediapipe) (1.4.0)\n",
"Requirement already satisfied: attrs>=19.1.0 in /usr/local/lib/python3.11/dist-packages (from mediapipe) (25.3.0)\n",
"Requirement already satisfied: flatbuffers>=2.0 in /usr/local/lib/python3.11/dist-packages (from mediapipe) (25.2.10)\n",
"Requirement already satisfied: jax in /usr/local/lib/python3.11/dist-packages (from mediapipe) (0.5.2)\n",
"Requirement already satisfied: jaxlib in /usr/local/lib/python3.11/dist-packages (from mediapipe) (0.5.1)\n",
"Requirement already satisfied: matplotlib in /usr/local/lib/python3.11/dist-packages (from mediapipe) (3.10.0)\n",
"Collecting numpy<2 (from mediapipe)\n",
" Downloading numpy-1.26.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (61 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m61.0/61.0 kB\u001b[0m \u001b[31m3.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hRequirement already satisfied: opencv-contrib-python in /usr/local/lib/python3.11/dist-packages (from mediapipe) (4.11.0.86)\n",
"Collecting protobuf<5,>=4.25.3 (from mediapipe)\n",
" Downloading protobuf-4.25.8-cp37-abi3-manylinux2014_x86_64.whl.metadata (541 bytes)\n",
"Collecting sounddevice>=0.4.4 (from mediapipe)\n",
" Downloading sounddevice-0.5.2-py3-none-any.whl.metadata (1.6 kB)\n",
"Requirement already satisfied: sentencepiece in /usr/local/lib/python3.11/dist-packages (from mediapipe) (0.2.0)\n",
"Requirement already satisfied: CFFI>=1.0 in /usr/local/lib/python3.11/dist-packages (from sounddevice>=0.4.4->mediapipe) (1.17.1)\n",
"Requirement already satisfied: ml_dtypes>=0.4.0 in /usr/local/lib/python3.11/dist-packages (from jax->mediapipe) (0.5.1)\n",
"Requirement already satisfied: opt_einsum in /usr/local/lib/python3.11/dist-packages (from jax->mediapipe) (3.4.0)\n",
"Requirement already satisfied: scipy>=1.11.1 in /usr/local/lib/python3.11/dist-packages (from jax->mediapipe) (1.15.3)\n",
"Requirement already satisfied: contourpy>=1.0.1 in /usr/local/lib/python3.11/dist-packages (from matplotlib->mediapipe) (1.3.2)\n",
"Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.11/dist-packages (from matplotlib->mediapipe) (0.12.1)\n",
"Requirement already satisfied: fonttools>=4.22.0 in /usr/local/lib/python3.11/dist-packages (from matplotlib->mediapipe) (4.58.5)\n",
"Requirement already satisfied: kiwisolver>=1.3.1 in /usr/local/lib/python3.11/dist-packages (from matplotlib->mediapipe) (1.4.8)\n",
"Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.11/dist-packages (from matplotlib->mediapipe) (24.2)\n",
"Requirement already satisfied: pillow>=8 in /usr/local/lib/python3.11/dist-packages (from matplotlib->mediapipe) (11.2.1)\n",
"Requirement already satisfied: pyparsing>=2.3.1 in /usr/local/lib/python3.11/dist-packages (from matplotlib->mediapipe) (3.2.3)\n",
"Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.11/dist-packages (from matplotlib->mediapipe) (2.9.0.post0)\n",
"Requirement already satisfied: pycparser in /usr/local/lib/python3.11/dist-packages (from CFFI>=1.0->sounddevice>=0.4.4->mediapipe) (2.22)\n",
"Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.11/dist-packages (from python-dateutil>=2.7->matplotlib->mediapipe) (1.17.0)\n",
"Downloading mediapipe-0.10.21-cp311-cp311-manylinux_2_28_x86_64.whl (35.6 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m35.6/35.6 MB\u001b[0m \u001b[31m64.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hDownloading numpy-1.26.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.3 MB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m18.3/18.3 MB\u001b[0m \u001b[31m112.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hDownloading protobuf-4.25.8-cp37-abi3-manylinux2014_x86_64.whl (294 kB)\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m294.9/294.9 kB\u001b[0m \u001b[31m29.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25hDownloading sounddevice-0.5.2-py3-none-any.whl (32 kB)\n",
"Installing collected packages: protobuf, numpy, sounddevice, mediapipe\n",
" Attempting uninstall: protobuf\n",
" Found existing installation: protobuf 5.29.5\n",
" Uninstalling protobuf-5.29.5:\n",
" Successfully uninstalled protobuf-5.29.5\n",
" Attempting uninstall: numpy\n",
" Found existing installation: numpy 2.0.2\n",
" Uninstalling numpy-2.0.2:\n",
" Successfully uninstalled numpy-2.0.2\n",
"\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n",
"grpcio-status 1.71.2 requires protobuf<6.0dev,>=5.26.1, but you have protobuf 4.25.8 which is incompatible.\n",
"tf-keras 2.18.0 requires tensorflow<2.19,>=2.18, but you have tensorflow 2.19.0 which is incompatible.\n",
"tensorflow-text 2.18.1 requires tensorflow<2.19,>=2.18.0, but you have tensorflow 2.19.0 which is incompatible.\n",
"ydf 0.12.0 requires protobuf<6.0.0,>=5.29.1, but you have protobuf 4.25.8 which is incompatible.\n",
"opencv-python-headless 4.12.0.88 requires numpy<2.3.0,>=2; python_version >= \"3.9\", but you have numpy 1.26.4 which is incompatible.\n",
"thinc 8.3.6 requires numpy<3.0.0,>=2.0.0, but you have numpy 1.26.4 which is incompatible.\n",
"tensorflow-decision-forests 1.11.0 requires tensorflow==2.18.0, but you have tensorflow 2.19.0 which is incompatible.\u001b[0m\u001b[31m\n",
"\u001b[0mSuccessfully installed mediapipe-0.10.21 numpy-1.26.4 protobuf-4.25.8 sounddevice-0.5.2\n"
]
},
{
"output_type": "display_data",
"data": {
"application/vnd.colab-display-data+json": {
"pip_warning": {
"packages": [
"google",
"numpy"
]
},
"id": "39abba471a0d4db1a62010247933bb32"
}
},
"metadata": {}
}
]
},
{
"cell_type": "code",
"source": [
"'''\n",
"# --- Hammer 2.1 0.5b Model Configuration ---\n",
"\n",
"# 1. Set the path to your converted Hammer TFLite model.\n",
"HAMMER_TFLITE_MODEL = '/content/ai-edge-torch/hammer_q8_ekv1280.tflite'\n",
"\n",
"# 2. Set the path to the Hammer tokenizer model file (e.g., 'tokenizer.model').\n",
"# This is the actual tokenizer file, not the JSON configuration file.\n",
"HAMMER_TOKENIZER_MODEL = '/content/tokenizer.model'\n",
"\n",
"# --- Define Hammer's Special Tokens and Prompt Structure ---\n",
"\n",
"START_TOKEN = \"<s>\"\n",
"\n",
"# Stop tokens signal the end of a turn ('<|im_end|>') or the end of the entire text ('<|endoftext|>').\n",
"STOP_TOKENS = [\"<|im_end|>\", \"<|endoftext|>\"]\n",
"\n",
"# The prefix to be added before the user's input.\n",
"# Format: <|im_start|>user\\n\n",
"PROMPT_PREFIX = \"<|im_start|>user\\n\"\n",
"\n",
"# The suffix to be added after the user's input, which cues the model's response.\n",
"# Format: <|im_end|>\\n<|im_start|>assistant\\n\n",
"PROMPT_SUFFIX = \"<|im_end|>\\n<|im_start|>assistant\\n\"\n",
"\n",
"# --- Create the MediaPipe GenAI Task Bundle ---\n",
"\n",
"print(f\"Starting to bundle the Hammer 2.1 0.5b model...\")\n",
"print(f\"TFLite Model: {HAMMER_TFLITE_MODEL}\")\n",
"print(f\"Tokenizer Model: {HAMMER_TOKENIZER_MODEL}\")\n",
"\n",
"# Define the output file path for the bundled model.\n",
"output_filename = \"/content/hammer.task\"\n",
"\n",
"# Configure the bundler with Hammer's specific settings.\n",
"config = bundler.BundleConfig(\n",
" tflite_model=HAMMER_TFLITE_MODEL,\n",
" tokenizer_model=HAMMER_TOKENIZER_MODEL,\n",
" start_token=START_TOKEN,\n",
" stop_tokens=STOP_TOKENS,\n",
" prompt_prefix=PROMPT_PREFIX,\n",
" prompt_suffix=PROMPT_SUFFIX,\n",
" output_filename=output_filename,\n",
")\n",
"\n",
"# Create the bundle.\n",
"bundler.create_bundle(config)\n",
"\n",
"print(f\"\\nSuccessfully created the model bundle at: {os.path.abspath(output_filename)}\")\n",
"'''"
],
"metadata": {
"id": "bB4q3Cp-fjXN"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [
"TFLITE_MODEL = \"/content/ai-edge-torch/hammer_q8_ekv1280.tflite\"\n",
"TOKENIZER_MODEL = \"/content/tokenizer.model\"\n",
"\n",
"from mediapipe.tasks.python.genai import bundler\n",
"\n",
"config = bundler.BundleConfig(\n",
" tflite_model=TFLITE_MODEL,\n",
" tokenizer_model=TOKENIZER_MODEL,\n",
" start_token=\"<|im_start|>user\\n\", # begin user turn\n",
" stop_tokens=[\"<|im_end|>\"], # end of any turn\n",
" output_filename=\"/content/hammer2p1_05b.task\",\n",
" prompt_prefix=\"\", # prefix is handled via start_token\n",
" prompt_suffix=\"<|im_end|>\\n<|im_start|>assistant\\n\", # close user, open assistant\n",
")\n",
"bundler.create_bundle(config)\n"
],
"metadata": {
"id": "UrpxPv6v4JXD"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"source": [],
"metadata": {
"id": "0TBsfzyl9FSb"
},
"execution_count": null,
"outputs": []
}
]
} |