Spaces:
Sleeping
Sleeping
File size: 108,737 Bytes
5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f 7bcf8d4 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 5a7ca9f de1a0f3 |
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 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 |
{
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "LBSYoWbi-45k"
},
"source": [
"# **Fine-tuning XLS-R for Multi-Lingual ASR with π€ Transformers**\n",
"\n",
"***New (11/2021)***: *This blog post has been updated to feature XLSR's successor, called [XLS-R](https://huggingface.co/models?other=xls_r)*."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "nT_QrfWtsxIz"
},
"source": [
"## Notebook Setup"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "wcHuXIaWyHZU"
},
"source": [
"First, let's try to get a good GPU in our colab! With Google Colab's free version it's sadly becoming much harder to get access to a good GPU. With Google Colab Pro, however, one should easily get either a V100 or P100 GPU."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "YELVqGxMxnbG",
"outputId": "70b5afa4-6790-4c60-821b-dd6600c8e092"
},
"outputs": [],
"source": [
"gpu_info = !nvidia-smi\n",
"gpu_info = '\\n'.join(gpu_info)\n",
"if gpu_info.find('failed') >= 0:\n",
" print('Not connected to a GPU')\n",
"else:\n",
" print(gpu_info)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "e335hPmdtASZ"
},
"source": [
"Before we start, let's install `datasets` and `transformers`. Also, we need the `torchaudio` to load audio files and `jiwer` to evaluate our fine-tuned model using the [word error rate (WER)](https://huggingface.co/metrics/wer) metric ${}^1$."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "c8eh87Hoee5d"
},
"outputs": [],
"source": [
"%%capture\n",
"!pip install datasets\n",
"!pip install -U datasets\n",
"!pip install -U transformers\n",
"!pip install huggingface_hub\n",
"!pip install torchaudio\n",
"!pip install jiwer\n",
"!pip install mlflow\n",
"!pip install fastds\n",
"!pip install dvc\n",
"!pip install dagshub"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "7FRuaqUOVLCt"
},
"outputs": [],
"source": [
"!fds clone https://dagshub.com/kingabzpro/Urdu-ASR-SOTA.git /content/Urdu-ASR"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Mn9swf6EQ9Vd"
},
"source": [
"\n",
"\n",
"\n",
"---\n",
"\n",
"${}^1$ In the [paper](https://arxiv.org/pdf/2006.13979.pdf), the model was evaluated using the phoneme error rate (PER), but by far the most common metric in ASR is the word error rate (WER). To keep this notebook as general as possible we decided to evaluate the model using WER."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "0mW-C1Nt-j7k"
},
"source": [
"## Prepare Data, Tokenizer, Feature Extractor"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "BeBosnY9BH3e"
},
"source": [
"ASR models transcribe speech to text, which means that we both need a feature extractor that processes the speech signal to the model's input format, *e.g.* a feature vector, and a tokenizer that processes the model's output format to text. \n",
"\n",
"In π€ Transformers, the XLS-R model is thus accompanied by both a tokenizer, called [Wav2Vec2CTCTokenizer](https://huggingface.co/transformers/master/model_doc/wav2vec2.html#wav2vec2ctctokenizer), and a feature extractor, called [Wav2Vec2FeatureExtractor](https://huggingface.co/transformers/master/model_doc/wav2vec2.html#wav2vec2featureextractor).\n",
"\n",
"Let's start by creating the tokenizer to decode the predicted output classes to the output transcription."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "sEXEWEJGQPqD"
},
"source": [
"### Create `Wav2Vec2CTCTokenizer`"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "tWmMikuNEKl_"
},
"source": [
"A pre-trained XLS-R model maps the speech signal to a sequence of context representations as illustrated in the figure above. However, for speech recognition the model has to to map this sequence of context representations to its corresponding transcription which means that a linear layer has to be added on top of the transformer block (shown in yellow in the diagram above). This linear layer is used to classifies each context representation to a token class analogous how, *e.g.*, after pretraining a linear layer is added on top of BERT's embeddings for further classification - *cf.* with *'BERT'* section of this [blog post](https://huggingface.co/blog/warm-starting-encoder-decoder)."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "v5oRE8XjIUH3"
},
"source": [
"The output size of this layer corresponds to the number of tokens in the vocabulary, which does **not** depend onXLS-R's pretraining task, but only on the labeled dataset used for fine-tuning. So in the first step, we will take a look at the chosen dataset of Common Voice and define a vocabulary based on the transcriptions."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "idBczw8mWzgt"
},
"source": [
"First, let's go to Common Voice [official website](https://commonvoice.mozilla.org/en/datasets) and pick a language to fine-tune XLS-R on. For this notebook, we will use Turkish. \n",
"\n",
"For each language-specific dataset, you can find a language code corresponding to your chosen language. On [Common Voice](https://commonvoice.mozilla.org/en/datasets), look for the field \"Version\". The language code then corresponds to the prefix before the underscore. For Urdu, *e.g.* the language code is `\"ur\"`.\n",
"\n",
"Great, now we can use π€ Datasets' simple API to download the data. The dataset name is `\"common_voice\"`, the configuration name corresponds to the language code, which is `\"ur\"` in our case."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "bee4g9rpLxll"
},
"source": [
"Common Voice has many different splits including `invalidated`, which refers to data that was not rated as \"clean enough\" to be considered useful. In this notebook, we will only make use of the splits `\"train\"`, `\"validation\"` and `\"test\"`. \n",
"\n",
"Because the Turkish dataset is so small, we will merge both the validation and training data into a training dataset and only use the test data for validation."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "QypfbmGCXQrF",
"outputId": "36f9026c-e027-4aac-cdf4-26e8ce7c46e8"
},
"outputs": [],
"source": [
"%cd /content/Urdu-ASR"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "2MMXcWFFgCXU",
"outputId": "37926a80-2de4-4c17-b14a-994c2fdca267"
},
"outputs": [],
"source": [
"from datasets import load_dataset, load_metric, Audio\n",
"\n",
"common_voice_train = load_dataset(\"Data\", \"ur\", delimiter=\"\\t\", split=\"train+validation\")\n",
"common_voice_test = load_dataset(\"Data\", \"ur\",delimiter=\"\\t\" ,split=\"test\")"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "ri5y5N_HMANq"
},
"source": [
"Many ASR datasets only provide the target text, `'sentence'` for each audio array `'audio'` and file `'path'`. Common Voice actually provides much more information about each audio file, such as the `'accent'`, etc. Keeping the notebook as general as possible, we only consider the transcribed text for fine-tuning.\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "kbyq6lDgQc2a"
},
"outputs": [],
"source": [
"common_voice_train = common_voice_train.remove_columns([\"accents\", \"age\", \"client_id\", \"down_votes\", \"gender\", \"locale\", \"segment\", \"up_votes\"])\n",
"common_voice_test = common_voice_test.remove_columns([\"accents\", \"age\", \"client_id\", \"down_votes\", \"gender\", \"locale\", \"segment\", \"up_votes\"])"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Go9Hq4e4NDT9"
},
"source": [
"Let's write a short function to display some random samples of the dataset and run it a couple of times to get a feeling for the transcriptions."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "QL4nSK5yR-Qh"
},
"outputs": [],
"source": [
"def cleaning(text):\n",
" if not isinstance(text, str):\n",
" return None\n",
"\n",
" return normalizer({\"sentence\": text}, return_dict=False)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "72737oog2F6U"
},
"outputs": [],
"source": [
"from datasets import ClassLabel\n",
"import random\n",
"import pandas as pd\n",
"from IPython.display import display, HTML\n",
"\n",
"def show_random_elements(dataset, num_examples=10):\n",
" assert num_examples <= len(dataset), \"Can't pick more elements than there are in the dataset.\"\n",
" picks = []\n",
" for _ in range(num_examples):\n",
" pick = random.randint(0, len(dataset)-1)\n",
" while pick in picks:\n",
" pick = random.randint(0, len(dataset)-1)\n",
" picks.append(pick)\n",
" \n",
" df = pd.DataFrame(dataset[picks])\n",
" display(HTML(df.to_html()))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 363
},
"id": "K_JUmf3G3b9S",
"outputId": "e6ecb9f8-241b-451e-ae6d-14d8dbbc27cd"
},
"outputs": [],
"source": [
"show_random_elements(common_voice_train, num_examples=10)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "fowcOllGNNju"
},
"source": [
"Alright! The transcriptions look fairly clean. Having translated the transcribed sentences, it seems that the language corresponds more to written-out text than noisy dialogue. This makes sense considering that [Common Voice](https://huggingface.co/datasets/common_voice) is a crowd-sourced read speech corpus."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "vq7OR50LN49m"
},
"source": [
"We can see that the transcriptions contain some special characters, such as `,.?!;:`. Without a language model, it is much harder to classify speech chunks to such special characters because they don't really correspond to a characteristic sound unit. *E.g.*, the letter `\"s\"` has a more or less clear sound, whereas the special character `\".\"` does not.\n",
"Also in order to understand the meaning of a speech signal, it is usually not necessary to include special characters in the transcription.\n",
"\n",
"Let's simply remove all characters that don't contribute to the meaning of a word and cannot really be represented by an acoustic sound and normalize the text."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "svKzVJ_hQGK6"
},
"outputs": [],
"source": [
"import re\n",
"import unicodedata\n",
"# chars_to_remove_regex = \"\"\"[\\!\\Ψ\\Ψ\\Ω«\\Ψ\\Ϋ\\Ωͺ\\\"\\'\\:\\-\\β\\β]\"\"\"\n",
"\n",
"def normalize_text(batch):\n",
" \"\"\"DO ADAPT FOR YOUR USE CASE. this function normalizes the target text.\"\"\"\n",
"\n",
" chars_to_ignore_regex = \"\"\"[\\!\\Ψ\\Ψ\\Ω«\\Ψ\\Ϋ\\Ωͺ\\\"\\'\\:\\-\\β\\β]\"\"\" # noqa: W605 IMPORTANT: this should correspond to the chars that were ignored during training\n",
" batch[\"sentence\"] = re.sub(chars_to_ignore_regex, \"\", batch[\"sentence\"].lower())\n",
" batch[\"sentence\"] = unicodedata.normalize(\"NFKC\", batch[\"sentence\"])\n",
"\n",
" # In addition, we can normalize the target text, e.g. removing new lines characters etc...\n",
" # note that order is important here!\n",
" # token_sequences_to_ignore = [\"\\n\\n\", \"\\n\", \" \", \" \"]\n",
"\n",
" # for t in token_sequences_to_ignore:\n",
" # batch[\"sentence\"] = \" \".join(batch[\"sentence\"].split(t))\n",
"\n",
" return batch"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "XIHocAuTQbBR"
},
"outputs": [],
"source": [
"# common_voice_train = common_voice_train.map(cleaning)\n",
"# common_voice_test = common_voice_test.map(cleaning)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "6dJq58N4SZ5f",
"outputId": "e4e17870-62aa-46f8-eb2a-222164fd6032"
},
"outputs": [],
"source": [
"common_voice_train = common_voice_train.map(normalize_text)\n",
"common_voice_test = common_voice_test.map(normalize_text)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "FwlkCjSHZ6T5"
},
"outputs": [],
"source": [
"def path_adjust(batch):\n",
" batch[\"path\"] = \"Data/ur/clips/\"+str(batch[\"path\"])\n",
" return batch"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "rWlDGlQwaWC-",
"outputId": "90ecf72c-4bf4-476e-d749-ef2fa3c98ee0"
},
"outputs": [],
"source": [
"common_voice_train = common_voice_train.map(path_adjust)\n",
"common_voice_test = common_voice_test.map(path_adjust)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "TxnVS9gIhIma"
},
"source": [
"Let's look at the processed text labels again."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 363
},
"id": "RBDRAAYxRE6n",
"outputId": "51d58128-c199-48d9-d201-b9d2500a9053"
},
"outputs": [],
"source": [
"show_random_elements(common_voice_train.remove_columns([\"path\"]))"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "3ORHDb2Th2TW"
},
"source": [
"In CTC, it is common to classify speech chunks into letters, so we will do the same here. \n",
"Let's extract all distinct letters of the training and test data and build our vocabulary from this set of letters.\n",
"\n",
"We write a mapping function that concatenates all transcriptions into one long transcription and then transforms the string into a set of chars. \n",
"It is important to pass the argument `batched=True` to the `map(...)` function so that the mapping function has access to all transcriptions at once."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "LwCshNbbeRZR"
},
"outputs": [],
"source": [
"def extract_all_chars(batch):\n",
" all_text = \" \".join(batch[\"sentence\"])\n",
" vocab = list(set(all_text))\n",
" return {\"vocab\": [vocab], \"all_text\": [all_text]}"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 81,
"referenced_widgets": [
"f36ef2953a78471f83668cc5b2dd3939",
"ddead8fbf3c049d9ba2f9230d3679dcd",
"b7b3f286421e4dfc9c31f6773f41a476",
"44ba7b2c76c34d3ca9a18b55cc22e1d0",
"972c7d2625c941aebcb703a05f36707d",
"fc082dad8009470aa0941f04b95a3dcc",
"184cd1a0e9ae44c1a2800cb34cf21f6e",
"e954f23548624e6dabd8416652033d82",
"e465fc21596a4e8ca0a88785135342f2",
"818ee624f78949d89d9a5db63c5d6d57",
"0802e170d72e4ff999697bf8ffd2c597",
"68175a4447a749a8a795355c8d1760f5",
"74a4b915a4c14c9f88c6c6915fef43aa",
"d3ee69375f624322945585683abd15d0",
"8a4f576b565940f48ee0141337eea9ad",
"c10ec5576e4540e2b3a80687c6a35203",
"cadb48a2a4f140bab83864f9a8bdc101",
"da985e2f1e604db69cffa3029b8ef3fa",
"957c2385c4d9492889dd1e563059a2eb",
"bd9423d7fd79440cba90b829e9f83f37",
"ed41e4dfba004526926e7f902b9bd4be",
"b720ea4e8f574bf9963d7a587fddcb1e"
]
},
"id": "_m6uUjjcfbjH",
"outputId": "09f290ad-ef91-425a-f16a-5f265ee679d6"
},
"outputs": [],
"source": [
"vocab_train = common_voice_train.map(extract_all_chars, batched=True, batch_size=-1, keep_in_memory=True, remove_columns=common_voice_train.column_names)\n",
"vocab_test = common_voice_test.map(extract_all_chars, batched=True, batch_size=-1, keep_in_memory=True, remove_columns=common_voice_test.column_names)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "7oVgE8RZSJNP"
},
"source": [
"Now, we create the union of all distinct letters in the training dataset and test dataset and convert the resulting list into an enumerated dictionary."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "aQfneNsmlJI0"
},
"outputs": [],
"source": [
"vocab_list = list(set(vocab_train[\"vocab\"][0]) | set(vocab_test[\"vocab\"][0]))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "_0kRndSvqaKk",
"outputId": "e2e3d448-9e8e-4de8-8c9a-f5b8f59004cb"
},
"outputs": [],
"source": [
"vocab_dict = {v: k for k, v in enumerate(sorted(vocab_list))}\n",
"vocab_dict"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "npbIbBoLgaFX"
},
"outputs": [],
"source": [
"vocab_dict[\"|\"] = vocab_dict[\" \"]\n",
"del vocab_dict[\" \"]"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "_9yCWg4Sd0cb"
},
"source": [
"Finally, we also add a padding token that corresponds to CTC's \"*blank token*\". The \"blank token\" is a core component of the CTC algorithm. For more information, please take a look at the \"Alignment\" section [here](https://distill.pub/2017/ctc/)."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "znF0bNunsjbl",
"outputId": "6b49557d-206e-4080-b82f-260391fa5be0"
},
"outputs": [],
"source": [
"vocab_dict[\"<unk>\"] = len(vocab_dict)\n",
"vocab_dict[\"<pad>\"] = len(vocab_dict)\n",
"vocab_dict[\"<s>\"] = len(vocab_dict)\n",
"vocab_dict[\"</s>\"] = len(vocab_dict)\n",
"len(vocab_dict)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "SFPGfet8U5sL"
},
"source": [
"Cool, now our vocabulary is complete and consists of 39 tokens, which means that the linear layer that we will add on top of the pretrained XLS-R checkpoint will have an output dimension of 39."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "1CujRgBNVRaD"
},
"source": [
"Let's now save the vocabulary as a json file."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "ehyUoh9vk191"
},
"outputs": [],
"source": [
"import json\n",
"with open('vocab.json', 'w') as vocab_file:\n",
" json.dump(vocab_dict, vocab_file)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "SHJDaKlIVVim"
},
"source": [
"In a final step, we use the json file to load the vocabulary into an instance of the `Wav2Vec2CTCTokenizer` class."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "xriFGEWQkO4M"
},
"outputs": [],
"source": [
"from transformers import Wav2Vec2CTCTokenizer\n",
"\n",
"tokenizer = Wav2Vec2CTCTokenizer(\"./vocab.json\", unk_token=\"<unk>\", pad_token=\"<pad>\", word_delimiter_token=\"|\", bos_token = \"<s>\", eos_token = \"</s>\")"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "SwQM8lH_GGuP"
},
"source": [
"Great, you can see the just created repository under `https://huggingface.co/<your-username>/wav2vec2-large-xls-r-300m-tr-colab`"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "mYcIiR2FQ96i"
},
"source": [
"### Create `Wav2Vec2FeatureExtractor`"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Y6mDEyW719rx"
},
"source": [
"Speech is a continuous signal and to be treated by computers, it first has to be discretized, which is usually called **sampling**. The sampling rate hereby plays an important role in that it defines how many data points of the speech signal are measured per second. Therefore, sampling with a higher sampling rate results in a better approximation of the *real* speech signal but also necessitates more values per second.\n",
"\n",
"A pretrained checkpoint expects its input data to have been sampled more or less from the same distribution as the data it was trained on. The same speech signals sampled at two different rates have a very different distribution, *e.g.*, doubling the sampling rate results in data points being twice as long. Thus, \n",
"before fine-tuning a pretrained checkpoint of an ASR model, it is crucial to verify that the sampling rate of the data that was used to pretrain the model matches the sampling rate of the dataset used to fine-tune the model.\n",
"\n",
"XLS-R was pretrained on audio data of [Babel](http://www.reading.ac.uk/AcaDepts/ll/speechlab/babel/r), \n",
"[Multilingual LibriSpeech (MLS)](https://huggingface.co/datasets/multilingual_librispeech), [Common Voice](https://huggingface.co/datasets/common_voice), [VoxPopuli](https://arxiv.org/abs/2101.00390), and [VoxLingua107](https://arxiv.org/abs/2011.12998) at a sampling rate of 16kHz. Common Voice, in its original form, has a sampling rate of 48kHz, thus we will have to downsample the fine-tuning data to 16kHz in the following.\n",
"\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "KuUbPW7oV-B5"
},
"source": [
"A `Wav2Vec2FeatureExtractor` object requires the following parameters to be instantiated:\n",
"\n",
"- `feature_size`: Speech models take a sequence of feature vectors as an input. While the length of this sequence obviously varies, the feature size should not. In the case of Wav2Vec2, the feature size is 1 because the model was trained on the raw speech signal ${}^2$.\n",
"- `sampling_rate`: The sampling rate at which the model is trained on.\n",
"- `padding_value`: For batched inference, shorter inputs need to be padded with a specific value\n",
"- `do_normalize`: Whether the input should be *zero-mean-unit-variance* normalized or not. Usually, speech models perform better when normalizing the input\n",
"- `return_attention_mask`: Whether the model should make use of an `attention_mask` for batched inference. In general, XLS-R models checkpoints should **always** use the `attention_mask`."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "kAR0-2KLkopp"
},
"outputs": [],
"source": [
"from transformers import Wav2Vec2FeatureExtractor\n",
"\n",
"feature_extractor = Wav2Vec2FeatureExtractor(feature_size=1, sampling_rate=16000, padding_value=0.0, do_normalize=True, return_attention_mask=True)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "qUETetgqYC3W"
},
"source": [
"Great, XLS-R's feature extraction pipeline is thereby fully defined!\n",
"\n",
"For improved user-friendliness, the feature extractor and tokenizer are *wrapped* into a single `Wav2Vec2Processor` class so that one only needs a `model` and `processor` object."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "KYZtoW-tlZgl"
},
"outputs": [],
"source": [
"from transformers import Wav2Vec2Processor,AutoProcessor, AutoModelForCTC\n",
"\n",
"processor = Wav2Vec2Processor(feature_extractor=feature_extractor, tokenizer=tokenizer)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "DrKnYuvDIoOO"
},
"source": [
"Next, we can prepare the dataset."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "YFmShnl7RE35"
},
"source": [
"### Preprocess Data\n",
"\n",
"So far, we have not looked at the actual values of the speech signal but just the transcription. In addition to `sentence`, our datasets include two more column names `path` and `audio`. `path` states the absolute path of the audio file. Let's take a look.\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "T6ndIjHGFp0W"
},
"source": [
"XLS-R expects the input in the format of a 1-dimensional array of 16 kHz. This means that the audio file has to be loaded and resampled.\n",
"\n",
" Thankfully, `datasets` does this automatically by calling the other column `audio`. Let try it out. "
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "WUUTgI1bGHW-"
},
"source": [
"Great, we can see that the audio file has automatically been loaded. This is thanks to the new [`\"Audio\"` feature](https://huggingface.co/docs/datasets/package_reference/main_classes.html?highlight=audio#datasets.Audio) introduced in `datasets == 4.13.3`, which loads and resamples audio files on-the-fly upon calling.\n",
"\n",
"In the example above we can see that the audio data is loaded with a sampling rate of 48kHz whereas 16kHz are expected by the model. We can set the audio feature to the correct sampling rate by making use of [`cast_column`](https://huggingface.co/docs/datasets/package_reference/main_classes.html?highlight=cast_column#datasets.DatasetDict.cast_column):"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "rrv65aj7G95i"
},
"outputs": [],
"source": [
"common_voice_train = common_voice_train.cast_column(\"path\", Audio(sampling_rate=16_000))\n",
"common_voice_test = common_voice_test.cast_column(\"path\", Audio(sampling_rate=16_000))"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "PcnO4x-NGBEi"
},
"source": [
"Let's take a look at `\"audio\"` again."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "aKtkc1o_HWHC",
"outputId": "41f7071a-7a05-493d-cf3e-96708c4fec59"
},
"outputs": [],
"source": [
"common_voice_train[0][\"path\"]"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "SOckzFd4Mbzq"
},
"source": [
"This seemed to have worked! Let's listen to a couple of audio files to better understand the dataset and verify that the audio was correctly loaded. \n",
"\n",
"**Note**: *You can click the following cell a couple of times to listen to different speech samples.*"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 93
},
"id": "dueM6U7Ev0OA",
"outputId": "9d0fce47-1d84-4f67-d190-9ec58f0d7c0b"
},
"outputs": [],
"source": [
"import IPython.display as ipd\n",
"import numpy as np\n",
"import random\n",
"\n",
"rand_int = random.randint(0, len(common_voice_train)-1)\n",
"\n",
"print(common_voice_train[rand_int][\"sentence\"])\n",
"ipd.Audio(data=common_voice_train[rand_int][\"path\"][\"array\"], autoplay=True, rate=16000)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "gY8m3vARHYTa"
},
"source": [
"It seems like the data is now correctly loaded and resampled. "
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "1MaL9J2dNVtG"
},
"source": [
"It can be heard, that the speakers change along with their speaking rate, accent, and background environment, etc. Overall, the recordings sound acceptably clear though, which is to be expected from a crowd-sourced read speech corpus.\n",
"\n",
"Let's do a final check that the data is correctly prepared, by printing the shape of the speech input, its transcription, and the corresponding sampling rate.\n",
"\n",
"**Note**: *You can click the following cell a couple of times to verify multiple samples.*"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "1Po2g7YPuRTx",
"outputId": "ee7c2161-39c7-4782-ed01-f799ff8800ef"
},
"outputs": [],
"source": [
"rand_int = random.randint(0, len(common_voice_train)-1)\n",
"\n",
"print(\"Target text:\", common_voice_train[rand_int][\"sentence\"])\n",
"print(\"Input array shape:\", common_voice_train[rand_int][\"path\"][\"array\"].shape)\n",
"print(\"Sampling rate:\", common_voice_train[rand_int][\"path\"][\"sampling_rate\"])"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "M9teZcSwOBJ4"
},
"source": [
"Good! Everything looks fine - the data is a 1-dimensional array, the sampling rate always corresponds to 16kHz, and the target text is normalized."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "k3Pbn5WvOYZF"
},
"source": [
"Finally, we can leverage `Wav2Vec2Processor` to process the data to the format expected by `Wav2Vec2ForCTC` for training. To do so let's make use of Dataset's [`map(...)`](https://huggingface.co/docs/datasets/package_reference/main_classes.html?highlight=map#datasets.DatasetDict.map) function.\n",
"\n",
"First, we load and resample the audio data, simply by calling `batch[\"audio\"]`.\n",
"Second, we extract the `input_values` from the loaded audio file. In our case, the `Wav2Vec2Processor` only normalizes the data. For other speech models, however, this step can include more complex feature extraction, such as [Log-Mel feature extraction](https://en.wikipedia.org/wiki/Mel-frequency_cepstrum). \n",
"Third, we encode the transcriptions to label ids.\n",
"\n",
"**Note**: This mapping function is a good example of how the `Wav2Vec2Processor` class should be used. In \"normal\" context, calling `processor(...)` is redirected to `Wav2Vec2FeatureExtractor`'s call method. When wrapping the processor into the `as_target_processor` context, however, the same method is redirected to `Wav2Vec2CTCTokenizer`'s call method.\n",
"For more information please check the [docs](https://huggingface.co/transformers/master/model_doc/wav2vec2.html#transformers.Wav2Vec2Processor.__call__)."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "eJY7I0XAwe9p"
},
"outputs": [],
"source": [
"def prepare_dataset(batch):\n",
" audio = batch[\"path\"]\n",
"\n",
" # batched output is \"un-batched\"\n",
" batch[\"input_values\"] = processor(audio[\"array\"], sampling_rate=audio[\"sampling_rate\"]).input_values[0]\n",
" batch[\"input_length\"] = len(batch[\"input_values\"])\n",
" \n",
" with processor.as_target_processor():\n",
" batch[\"labels\"] = processor(batch[\"sentence\"]).input_ids\n",
" return batch"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "q6Pg_WR3OGAP"
},
"source": [
"Let's apply the data preparation function to all examples."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 81,
"referenced_widgets": [
"1149c8d876b8434db67f23f8d0cf4e54",
"acdbfc9bae2f40689944317666bd33ba",
"80cbdf747dfe45939c266bf31e7042d8",
"a19d35352882473e88e7cd9900f04b18",
"5bd22dfd12084f1381137dc9bf0d26eb",
"5411fe5b9c994caeacb21abd6bd82374",
"c80c0d69b86f470d8f5e9922d696404d",
"b58e9a584f734e718a857cdbdb671cba",
"e21e3d3ba70147b09dd025986c88264d",
"e11b5cd77825455587255870b5bfbd52",
"7888cf9b3dd04c6e86be0cc691915063",
"7d780bbaf63c4398bcb4cdd7b7a420f8",
"005bfde85ca84ac2baeecca8b29e8128",
"be3bfc1639014762af07c228030d2f49",
"2e52b247ac7140e1b009141a20e0e4e0",
"9be9f0c4290a446c883bfce80da460fe",
"3bd607444dc6462089423e0044c49e16",
"8c4a4c3b2c4441b1b945d249b2c3d765",
"5379091c1a344d9382b4fd50e675b11e",
"6b75b166f7fc4a71b710f6be726a955b",
"9d951e2829464ae3bcbd596352e3af2d",
"e6ae489f1dcf48eb9f154dfc4a6e38a7"
]
},
"id": "-np9xYK-wl8q",
"outputId": "1b0dfd2f-1eb3-4c45-c0cf-34bcf6976093"
},
"outputs": [],
"source": [
"common_voice_train = common_voice_train.map(prepare_dataset, remove_columns=common_voice_train.column_names)\n",
"common_voice_test = common_voice_test.map(prepare_dataset, remove_columns=common_voice_test.column_names)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "nKcEWHvKI1by"
},
"source": [
"**Note**: Currently `datasets` make use of [`torchaudio`](https://pytorch.org/audio/stable/index.html) and [`librosa`](https://librosa.org/doc/latest/index.html) for audio loading and resampling. If you wish to implement your own costumized data loading/sampling, feel free to just make use of the `\"path\"` column instead and disregard the `\"audio\"` column."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "24CxHd5ewI4T"
},
"source": [
"Long input sequences require a lot of memory. XLS-R is based on `self-attention` the memory requirement scales quadratically with the input length for long input sequences (*cf.* with [this](https://www.reddit.com/r/MachineLearning/comments/genjvb/d_why_is_the_maximum_input_sequence_length_of/) reddit post). In case this demo crashes with an \"Out-of-memory\" error for you, you might want to uncomment the following lines to filter all sequences that are longer than 5 seconds for training."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "tdHfbUJ_09iA"
},
"outputs": [],
"source": [
"#max_input_length_in_sec = 5.0\n",
"#common_voice_train = common_voice_train.filter(lambda x: x < max_input_length_in_sec * processor.feature_extractor.sampling_rate, input_columns=[\"input_length\"])"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "1ZWDCCKqwcfS"
},
"source": [
"Awesome, now we are ready to start training!"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "gYlQkKVoRUos"
},
"source": [
"## Training\n",
"\n",
"The data is processed so that we are ready to start setting up the training pipeline. We will make use of π€'s [Trainer](https://huggingface.co/transformers/master/main_classes/trainer.html?highlight=trainer) for which we essentially need to do the following:\n",
"\n",
"- Define a data collator. In contrast to most NLP models, XLS-R has a much larger input length than output length. *E.g.*, a sample of input length 50000 has an output length of no more than 100. Given the large input sizes, it is much more efficient to pad the training batches dynamically meaning that all training samples should only be padded to the longest sample in their batch and not the overall longest sample. Therefore, fine-tuning XLS-R requires a special padding data collator, which we will define below\n",
"\n",
"- Evaluation metric. During training, the model should be evaluated on the word error rate. We should define a `compute_metrics` function accordingly\n",
"\n",
"- Load a pretrained checkpoint. We need to load a pretrained checkpoint and configure it correctly for training.\n",
"\n",
"- Define the training configuration.\n",
"\n",
"After having fine-tuned the model, we will correctly evaluate it on the test data and verify that it has indeed learned to correctly transcribe speech."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Slk403unUS91"
},
"source": [
"### Set-up Trainer\n",
"\n",
"Let's start by defining the data collator. The code for the data collator was copied from [this example](https://github.com/huggingface/transformers/blob/7e61d56a45c19284cfda0cee8995fb552f6b1f4e/examples/pytorch/speech-recognition/run_speech_recognition_ctc.py#L219).\n",
"\n",
"Without going into too many details, in contrast to the common data collators, this data collator treats the `input_values` and `labels` differently and thus applies to separate padding functions on them (again making use of XLS-R processor's context manager). This is necessary because in speech input and output are of different modalities meaning that they should not be treated by the same padding function.\n",
"Analogous to the common data collators, the padding tokens in the labels with `-100` so that those tokens are **not** taken into account when computing the loss."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "tborvC9hx88e"
},
"outputs": [],
"source": [
"import torch\n",
"\n",
"from dataclasses import dataclass, field\n",
"from typing import Any, Dict, List, Optional, Union\n",
"\n",
"@dataclass\n",
"class DataCollatorCTCWithPadding:\n",
" \"\"\"\n",
" Data collator that will dynamically pad the inputs received.\n",
" Args:\n",
" processor (:class:`~transformers.Wav2Vec2Processor`)\n",
" The processor used for proccessing the data.\n",
" padding (:obj:`bool`, :obj:`str` or :class:`~transformers.tokenization_utils_base.PaddingStrategy`, `optional`, defaults to :obj:`True`):\n",
" Select a strategy to pad the returned sequences (according to the model's padding side and padding index)\n",
" among:\n",
" * :obj:`True` or :obj:`'longest'`: Pad to the longest sequence in the batch (or no padding if only a single\n",
" sequence if provided).\n",
" * :obj:`'max_length'`: Pad to a maximum length specified with the argument :obj:`max_length` or to the\n",
" maximum acceptable input length for the model if that argument is not provided.\n",
" * :obj:`False` or :obj:`'do_not_pad'` (default): No padding (i.e., can output a batch with sequences of\n",
" different lengths).\n",
" \"\"\"\n",
"\n",
" processor: Wav2Vec2Processor\n",
" padding: Union[bool, str] = True\n",
"\n",
" def __call__(self, features: List[Dict[str, Union[List[int], torch.Tensor]]]) -> Dict[str, torch.Tensor]:\n",
" # split inputs and labels since they have to be of different lenghts and need\n",
" # different padding methods\n",
" input_features = [{\"input_values\": feature[\"input_values\"]} for feature in features]\n",
" label_features = [{\"input_ids\": feature[\"labels\"]} for feature in features]\n",
"\n",
" batch = self.processor.pad(\n",
" input_features,\n",
" padding=self.padding,\n",
" return_tensors=\"pt\",\n",
" )\n",
" with self.processor.as_target_processor():\n",
" labels_batch = self.processor.pad(\n",
" label_features,\n",
" padding=self.padding,\n",
" return_tensors=\"pt\",\n",
" )\n",
"\n",
" # replace padding with -100 to ignore loss correctly\n",
" labels = labels_batch[\"input_ids\"].masked_fill(labels_batch.attention_mask.ne(1), -100)\n",
"\n",
" batch[\"labels\"] = labels\n",
"\n",
" return batch"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "lbQf5GuZyQ4_"
},
"outputs": [],
"source": [
"data_collator = DataCollatorCTCWithPadding(processor=processor, padding=True)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "xO-Zdj-5cxXp"
},
"source": [
"Next, the evaluation metric is defined. As mentioned earlier, the \n",
"predominant metric in ASR is the word error rate (WER), hence we will use it in this notebook as well."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "9Xsux2gmyXso"
},
"outputs": [],
"source": [
"wer_metric = load_metric(\"wer\")\n",
"cer_metric = load_metric(\"cer\")"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "E1qZU5p-deqB"
},
"source": [
"The model will return a sequence of logit vectors:\n",
"$\\mathbf{y}_1, \\ldots, \\mathbf{y}_m$ with $\\mathbf{y}_1 = f_{\\theta}(x_1, \\ldots, x_n)[0]$ and $n >> m$.\n",
"\n",
"A logit vector $\\mathbf{y}_1$ contains the log-odds for each word in the vocabulary we defined earlier, thus $\\text{len}(\\mathbf{y}_i) =$ `config.vocab_size`. We are interested in the most likely prediction of the model and thus take the `argmax(...)` of the logits. Also, we transform the encoded labels back to the original string by replacing `-100` with the `pad_token_id` and decoding the ids while making sure that consecutive tokens are **not** grouped to the same token in CTC style ${}^1$."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "1XZ-kjweyTy_"
},
"outputs": [],
"source": [
"def compute_metrics(pred):\n",
" pred_logits = pred.predictions\n",
" pred_ids = np.argmax(pred_logits, axis=-1)\n",
"\n",
" pred.label_ids[pred.label_ids == -100] = processor.tokenizer.pad_token_id\n",
"\n",
" pred_str = processor.batch_decode(pred_ids)\n",
" # we do not want to group tokens when computing the metrics\n",
" label_str = processor.batch_decode(pred.label_ids, group_tokens=False)\n",
"\n",
" wer = wer_metric.compute(predictions=pred_str, references=label_str)\n",
" cer = cer_metric.compute(predictions=pred_str, references=label_str)\n",
" return {\"wer\" : wer, \"cer\" : cer}"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "Xmgrx4bRwLIH"
},
"source": [
"Now, we can load the pretrained checkpoint of [Wav2Vec2-XLS-R-300M](https://huggingface.co/facebook/wav2vec2-xls-r-300m). The tokenizer's `pad_token_id` must be to define the model's `pad_token_id` or in the case of `Wav2Vec2ForCTC` also CTC's *blank token* ${}^2$. To save GPU memory, we enable PyTorch's [gradient checkpointing](https://pytorch.org/docs/stable/checkpoint.html) and also set the loss reduction to \"*mean*\".\n",
"\n",
"Because the dataset is quite small (~6h of training data) and because Common Voice is quite noisy, fine-tuning Facebook's [wav2vec2-xls-r-300m checkpoint](https://huggingface.co/facebook/wav2vec2-xls-r-300m) seems to require some hyper-parameter tuning. Therefore, I had to play around a bit with different values for dropout, [SpecAugment](https://arxiv.org/abs/1904.08779)'s masking dropout rate, layer dropout, and the learning rate until training seemed to be stable enough. \n",
"\n",
"**Note**: When using this notebook to train XLS-R on another language of Common Voice those hyper-parameter settings might not work very well. Feel free to adapt those depending on your use case. "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "e7cqAWIayn6w",
"outputId": "be39113a-c3aa-44b9-d154-90c8b6439717"
},
"outputs": [],
"source": [
"from transformers import Wav2Vec2ForCTC\n",
"\n",
"model = Wav2Vec2ForCTC.from_pretrained(\n",
" \"facebook/wav2vec2-xls-r-300m\", \n",
" attention_dropout=0.1,\n",
" layerdrop=0.0,\n",
" feat_proj_dropout=0.0,\n",
" mask_time_prob=0.75,\n",
" mask_time_length=10,\n",
" mask_feature_prob=0.25,\n",
" mask_feature_length=64,\n",
" ctc_loss_reduction=\"mean\", \n",
" pad_token_id=processor.tokenizer.pad_token_id,\n",
" vocab_size=len(processor.tokenizer),\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "1DwR3XLSzGDD"
},
"source": [
"The first component of XLS-R consists of a stack of CNN layers that are used to extract acoustically meaningful - but contextually independent - features from the raw speech signal. This part of the model has already been sufficiently trained during pretraining and as stated in the [paper](https://arxiv.org/pdf/2006.13979.pdf) does not need to be fine-tuned anymore. \n",
"Thus, we can set the `requires_grad` to `False` for all parameters of the *feature extraction* part."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "oGI8zObtZ3V0",
"outputId": "5972978a-f8c8-4ff8-c6f2-41113ef3c56f"
},
"outputs": [],
"source": [
"model.freeze_feature_extractor()"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "lD4aGhQM0K-D"
},
"source": [
"In a final step, we define all parameters related to training. \n",
"To give more explanation on some of the parameters:\n",
"- `group_by_length` makes training more efficient by grouping training samples of similar input length into one batch. This can significantly speed up training time by heavily reducing the overall number of useless padding tokens that are passed through the model\n",
"- `learning_rate` and `weight_decay` were heuristically tuned until fine-tuning has become stable. Note that those parameters strongly depend on the Common Voice dataset and might be suboptimal for other speech datasets.\n",
"\n",
"For more explanations on other parameters, one can take a look at the [docs](https://huggingface.co/transformers/master/main_classes/trainer.html?highlight=trainer#trainingarguments).\n",
"\n",
"During training, a checkpoint will be uploaded asynchronously to the hub every 400 training steps. It allows you to also play around with the demo widget even while your model is still training.\n",
"\n",
"**Note**: If one does not want to upload the model checkpoints to the hub, simply set `push_to_hub=False`."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "Xzn6034AOaUT"
},
"outputs": [],
"source": [
"import os\n",
"os.environ['MLFLOW_TRACKING_USERNAME'] = \"kingabzpro\"\n",
"os.environ['MLFLOW_TRACKING_PASSWORD'] = \"\""
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "KbeKSV7uzGPP"
},
"outputs": [],
"source": [
"from transformers import TrainingArguments\n",
"\n",
"training_args = TrainingArguments(\n",
" output_dir=\"Model\",\n",
" group_by_length=True,\n",
" per_device_train_batch_size=32,\n",
" gradient_accumulation_steps=2,\n",
" evaluation_strategy=\"steps\",\n",
" num_train_epochs=200,\n",
" gradient_checkpointing=True,\n",
" fp16=True,\n",
" save_steps=400,\n",
" eval_steps=400,\n",
" logging_steps=400,\n",
" learning_rate=1e-4,\n",
" warmup_steps=1000,\n",
" save_total_limit=2,\n",
")"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "OsW-WZcL1ZtN"
},
"source": [
"Now, all instances can be passed to Trainer and we are ready to start training!"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "zp7scktZJIBd"
},
"outputs": [],
"source": [
"from transformers.integrations import TensorBoardCallback,MLflowCallback"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "rY7vBmFCPFgC",
"outputId": "b80818ca-d083-408d-a382-0b4902107815"
},
"outputs": [],
"source": [
"from transformers import Trainer\n",
"\n",
"\n",
"trainer = Trainer(\n",
" model=model,\n",
" data_collator=data_collator,\n",
" args=training_args,\n",
" compute_metrics=compute_metrics,\n",
" train_dataset=common_voice_train,\n",
" eval_dataset=common_voice_test,\n",
" tokenizer=processor.feature_extractor,\n",
" callbacks=[MLflowCallback]\n",
")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "Bq9tPZVg92pW",
"outputId": "0f02a82a-f9e5-4dab-8711-7d0151423d7c"
},
"outputs": [],
"source": [
"trainer.get_optimizer_cls_and_kwargs(training_args)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "gUZbbfa3MWfW"
},
"outputs": [],
"source": [
"trainer.remove_callback(TensorBoardCallback)"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "UoXBx1JAA0DX"
},
"source": [
"\n",
"\n",
"---\n",
"\n",
"${}^1$ To allow models to become independent of the speaker rate, in CTC, consecutive tokens that are identical are simply grouped as a single token. However, the encoded labels should not be grouped when decoding since they don't correspond to the predicted tokens of the model, which is why the `group_tokens=False` parameter has to be passed. If we wouldn't pass this parameter a word like `\"hello\"` would incorrectly be encoded, and decoded as `\"helo\"`.\n",
"\n",
"${}^2$ The blank token allows the model to predict a word, such as `\"hello\"` by forcing it to insert the blank token between the two l's. A CTC-conform prediction of `\"hello\"` of our model would be `[PAD] [PAD] \"h\" \"e\" \"e\" \"l\" \"l\" [PAD] \"l\" \"o\" \"o\" [PAD]`."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "rpvZHM1xReIW"
},
"source": [
"### Training"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "rWlS5WsqIWPF"
},
"outputs": [],
"source": [
"import mlflow"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "Ionf-3KGuzXY"
},
"outputs": [],
"source": [
"# mlflow.delete_run(\"d4caf8e76ce14040b0c8ccf3f306f89d\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "dBgk8Uaw1BqC"
},
"outputs": [],
"source": [
"# mlflow.set_experiment(experiment_id=0)\n",
"# with mlflow.start_run(run_id=\"2a28fb02c3ce4670997d5303f0de7118\") as run:\n",
"# mlflow.set_tag('mlflow.source.git.commit', \"d316332f0def9d679491b81b2b35aee7bbf21457\") "
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "ccHvQwNw1taG"
},
"outputs": [],
"source": [
"# mlflow.end_run()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 717
},
"id": "9fRr9TG5pGBl",
"outputId": "ab7bf491-44e6-4dba-c42f-af33e6b56f06"
},
"outputs": [],
"source": [
"mlflow.set_tracking_uri(\"https://dagshub.com/kingabzpro/Urdu-ASR-SOTA.mlflow\")\n",
"# mlflow.set_tag('mlflow.source.git.commit', \"d316332f0def9d679491b81b2b35aee7bbf21457\") \n",
"trainer.train()\n",
"mlflow.end_run()"
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "a9q4mgMZplr_"
},
"source": [
"The training loss and validation WER go down nicely."
]
},
{
"cell_type": "markdown",
"metadata": {
"id": "4Ya7WEy0pd13"
},
"source": [
"You can now upload the result of the training to the π€ Hub, just execute this instruction:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "m6w5pWkLT5qn"
},
"outputs": [],
"source": [
"import dagshub\n",
"\n",
"with dagshub.dagshub_logger() as logger:\n",
" logger.log_hyperparams(model_class=\"wav2vec2-xls-r-300m\")\n",
" logger.log_hyperparams(training_args.to_dict())\n",
" logger.log_metrics(trainer.evaluate())"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "ElIer3iRbzEh"
},
"outputs": [],
"source": [
"!dvc remote add origin https://dagshub.com/kingabzpro/Urdu-ASR-SOTA.dvc\n",
"!dvc remote modify origin --local auth basic\n",
"!dvc remote modify origin --local user kingabzpro\n",
"!dvc remote modify origin --local password <pass>"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"id": "ArG1Thf6NBWm"
},
"outputs": [],
"source": [
"!fds commit -m \"second experiment\"\n",
"!fds push origin"
]
}
],
"metadata": {
"accelerator": "GPU",
"colab": {
"collapsed_sections": [],
"machine_shape": "hm",
"name": "Urdu_Fine_Tune_XLS_R_on_Common_Voice (3).ipynb",
"provenance": []
},
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.7"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"005bfde85ca84ac2baeecca8b29e8128": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_3bd607444dc6462089423e0044c49e16",
"placeholder": "β",
"style": "IPY_MODEL_8c4a4c3b2c4441b1b945d249b2c3d765",
"value": ""
}
},
"0802e170d72e4ff999697bf8ffd2c597": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"1149c8d876b8434db67f23f8d0cf4e54": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HBoxModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_acdbfc9bae2f40689944317666bd33ba",
"IPY_MODEL_80cbdf747dfe45939c266bf31e7042d8",
"IPY_MODEL_a19d35352882473e88e7cd9900f04b18"
],
"layout": "IPY_MODEL_5bd22dfd12084f1381137dc9bf0d26eb"
}
},
"184cd1a0e9ae44c1a2800cb34cf21f6e": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"2e52b247ac7140e1b009141a20e0e4e0": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_9d951e2829464ae3bcbd596352e3af2d",
"placeholder": "β",
"style": "IPY_MODEL_e6ae489f1dcf48eb9f154dfc4a6e38a7",
"value": " 341/? [00:02<00:00, 113.05ex/s]"
}
},
"3bd607444dc6462089423e0044c49e16": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"44ba7b2c76c34d3ca9a18b55cc22e1d0": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_818ee624f78949d89d9a5db63c5d6d57",
"placeholder": "β",
"style": "IPY_MODEL_0802e170d72e4ff999697bf8ffd2c597",
"value": " 1/1 [00:00<00:00, 11.10ba/s]"
}
},
"5379091c1a344d9382b4fd50e675b11e": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": "20px"
}
},
"5411fe5b9c994caeacb21abd6bd82374": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"5bd22dfd12084f1381137dc9bf0d26eb": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"68175a4447a749a8a795355c8d1760f5": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HBoxModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_74a4b915a4c14c9f88c6c6915fef43aa",
"IPY_MODEL_d3ee69375f624322945585683abd15d0",
"IPY_MODEL_8a4f576b565940f48ee0141337eea9ad"
],
"layout": "IPY_MODEL_c10ec5576e4540e2b3a80687c6a35203"
}
},
"6b75b166f7fc4a71b710f6be726a955b": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "ProgressStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"74a4b915a4c14c9f88c6c6915fef43aa": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_cadb48a2a4f140bab83864f9a8bdc101",
"placeholder": "β",
"style": "IPY_MODEL_da985e2f1e604db69cffa3029b8ef3fa",
"value": "100%"
}
},
"7888cf9b3dd04c6e86be0cc691915063": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"7d780bbaf63c4398bcb4cdd7b7a420f8": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HBoxModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_005bfde85ca84ac2baeecca8b29e8128",
"IPY_MODEL_be3bfc1639014762af07c228030d2f49",
"IPY_MODEL_2e52b247ac7140e1b009141a20e0e4e0"
],
"layout": "IPY_MODEL_9be9f0c4290a446c883bfce80da460fe"
}
},
"80cbdf747dfe45939c266bf31e7042d8": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "FloatProgressModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_b58e9a584f734e718a857cdbdb671cba",
"max": 1,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_e21e3d3ba70147b09dd025986c88264d",
"value": 1
}
},
"818ee624f78949d89d9a5db63c5d6d57": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"8a4f576b565940f48ee0141337eea9ad": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_ed41e4dfba004526926e7f902b9bd4be",
"placeholder": "β",
"style": "IPY_MODEL_b720ea4e8f574bf9963d7a587fddcb1e",
"value": " 1/1 [00:00<00:00, 21.88ba/s]"
}
},
"8c4a4c3b2c4441b1b945d249b2c3d765": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"957c2385c4d9492889dd1e563059a2eb": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"972c7d2625c941aebcb703a05f36707d": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"9be9f0c4290a446c883bfce80da460fe": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"9d951e2829464ae3bcbd596352e3af2d": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"a19d35352882473e88e7cd9900f04b18": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_e11b5cd77825455587255870b5bfbd52",
"placeholder": "β",
"style": "IPY_MODEL_7888cf9b3dd04c6e86be0cc691915063",
"value": " 2080/? [00:29<00:00, 88.42ex/s]"
}
},
"acdbfc9bae2f40689944317666bd33ba": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_5411fe5b9c994caeacb21abd6bd82374",
"placeholder": "β",
"style": "IPY_MODEL_c80c0d69b86f470d8f5e9922d696404d",
"value": ""
}
},
"b58e9a584f734e718a857cdbdb671cba": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": "20px"
}
},
"b720ea4e8f574bf9963d7a587fddcb1e": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"b7b3f286421e4dfc9c31f6773f41a476": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "FloatProgressModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_e954f23548624e6dabd8416652033d82",
"max": 1,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_e465fc21596a4e8ca0a88785135342f2",
"value": 1
}
},
"bd9423d7fd79440cba90b829e9f83f37": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "ProgressStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"be3bfc1639014762af07c228030d2f49": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "FloatProgressModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_5379091c1a344d9382b4fd50e675b11e",
"max": 1,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_6b75b166f7fc4a71b710f6be726a955b",
"value": 1
}
},
"c10ec5576e4540e2b3a80687c6a35203": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"c80c0d69b86f470d8f5e9922d696404d": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"cadb48a2a4f140bab83864f9a8bdc101": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"d3ee69375f624322945585683abd15d0": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "FloatProgressModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_957c2385c4d9492889dd1e563059a2eb",
"max": 1,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_bd9423d7fd79440cba90b829e9f83f37",
"value": 1
}
},
"da985e2f1e604db69cffa3029b8ef3fa": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"ddead8fbf3c049d9ba2f9230d3679dcd": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HTMLModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_fc082dad8009470aa0941f04b95a3dcc",
"placeholder": "β",
"style": "IPY_MODEL_184cd1a0e9ae44c1a2800cb34cf21f6e",
"value": "100%"
}
},
"e11b5cd77825455587255870b5bfbd52": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"e21e3d3ba70147b09dd025986c88264d": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "ProgressStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"e465fc21596a4e8ca0a88785135342f2": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "ProgressStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"e6ae489f1dcf48eb9f154dfc4a6e38a7": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "DescriptionStyleModel",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"e954f23548624e6dabd8416652033d82": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"ed41e4dfba004526926e7f902b9bd4be": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"f36ef2953a78471f83668cc5b2dd3939": {
"model_module": "@jupyter-widgets/controls",
"model_module_version": "1.5.0",
"model_name": "HBoxModel",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_ddead8fbf3c049d9ba2f9230d3679dcd",
"IPY_MODEL_b7b3f286421e4dfc9c31f6773f41a476",
"IPY_MODEL_44ba7b2c76c34d3ca9a18b55cc22e1d0"
],
"layout": "IPY_MODEL_972c7d2625c941aebcb703a05f36707d"
}
},
"fc082dad8009470aa0941f04b95a3dcc": {
"model_module": "@jupyter-widgets/base",
"model_module_version": "1.2.0",
"model_name": "LayoutModel",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
}
}
}
},
"nbformat": 4,
"nbformat_minor": 0
}
|