Spaces:
Runtime error
Runtime error
File size: 168,584 Bytes
4222961 |
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 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 |
{
"nbformat": 4,
"nbformat_minor": 0,
"metadata": {
"colab": {
"provenance": [],
"authorship_tag": "ABX9TyPPjVdZrv5/UZFghwDUZh1J",
"include_colab_link": true
},
"kernelspec": {
"name": "python3",
"display_name": "Python 3"
},
"language_info": {
"name": "python"
},
"widgets": {
"application/vnd.jupyter.widget-state+json": {
"c0b665c08bef417ca1d05f94ec9a5c3f": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_4eff29821a414aa5820b95e2940bdb0f",
"IPY_MODEL_7f9dae839b3c4b1585fa2951b96e673b",
"IPY_MODEL_57a3f526d5b04940b2b8bb9fe49c03f6"
],
"layout": "IPY_MODEL_d269bf7f993a489eb114a5e805129a80"
}
},
"4eff29821a414aa5820b95e2940bdb0f": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_7a7ecf5c9aad41c7b7133ce4f1219bc1",
"placeholder": "",
"style": "IPY_MODEL_ed5073c9a9f2456daafe17cab376032e",
"value": "Downloading (…)okenizer_config.json: 100%"
}
},
"7f9dae839b3c4b1585fa2951b96e673b": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_479e9a7032e34239ad7bbbc2ff561ca5",
"max": 367,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_2e91ae1e3a384ab8b0c8820a5caf7e4a",
"value": 367
}
},
"57a3f526d5b04940b2b8bb9fe49c03f6": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_f5241199fb7c48418d0ecb3f05e51cfe",
"placeholder": "",
"style": "IPY_MODEL_963dbf6abb77417580969dc7a6c7da16",
"value": " 367/367 [00:00<00:00, 4.28kB/s]"
}
},
"d269bf7f993a489eb114a5e805129a80": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"7a7ecf5c9aad41c7b7133ce4f1219bc1": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"ed5073c9a9f2456daafe17cab376032e": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"479e9a7032e34239ad7bbbc2ff561ca5": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"2e91ae1e3a384ab8b0c8820a5caf7e4a": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"f5241199fb7c48418d0ecb3f05e51cfe": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"963dbf6abb77417580969dc7a6c7da16": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"eda5b0345b67487ea4930bec37d57d3c": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_4c3e9f44fe8c4b158657edfb3b758e95",
"IPY_MODEL_9824ffdf106a4eb3b367ee6bed1974c0",
"IPY_MODEL_2d8382863e574a0dbb92baed5b151a01"
],
"layout": "IPY_MODEL_d45ef4f4c8f247838dc739eb172a2ac3"
}
},
"4c3e9f44fe8c4b158657edfb3b758e95": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_80f031769941428a954af3fabd0d0281",
"placeholder": "",
"style": "IPY_MODEL_00c54bf3e23a459781b28e5ce93172c6",
"value": "Downloading (…)solve/main/vocab.txt: 100%"
}
},
"9824ffdf106a4eb3b367ee6bed1974c0": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_8faba71df27c430c8ada308c90cb2a34",
"max": 109540,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_a1c99102d5054c5499af73787b43bcf3",
"value": 109540
}
},
"2d8382863e574a0dbb92baed5b151a01": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_2342d9faa5f040b5b1b64777abcad90f",
"placeholder": "",
"style": "IPY_MODEL_130c45c974b74f068dc8bfe4be31970d",
"value": " 110k/110k [00:00<00:00, 1.22MB/s]"
}
},
"d45ef4f4c8f247838dc739eb172a2ac3": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"80f031769941428a954af3fabd0d0281": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"00c54bf3e23a459781b28e5ce93172c6": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"8faba71df27c430c8ada308c90cb2a34": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"a1c99102d5054c5499af73787b43bcf3": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"2342d9faa5f040b5b1b64777abcad90f": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"130c45c974b74f068dc8bfe4be31970d": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"ec229f1096364ca484b15b77f69dc7c1": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_b7bcfdcfd853449d9792986accc2e7bf",
"IPY_MODEL_8811779db6c24e96b502d08061ee9019",
"IPY_MODEL_79d9be68ca01426eba3694d72e50e573"
],
"layout": "IPY_MODEL_cd8794f5cd63413492fcf0751b59d7c1"
}
},
"b7bcfdcfd853449d9792986accc2e7bf": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_ea13f162e41247eca933d05da85b8915",
"placeholder": "",
"style": "IPY_MODEL_ad31c0a39a3342b086249ced4f3d4b91",
"value": "Downloading (…)/main/tokenizer.json: 100%"
}
},
"8811779db6c24e96b502d08061ee9019": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_daf46ea6f47b483fa9bad5fb97981cf0",
"max": 439125,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_6d91fb18977743e8b69400ceae8fe733",
"value": 439125
}
},
"79d9be68ca01426eba3694d72e50e573": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_d46bf604ce504085848afe2cf16ac297",
"placeholder": "",
"style": "IPY_MODEL_acd514f0d28f424f9b69964174143894",
"value": " 439k/439k [00:00<00:00, 3.33MB/s]"
}
},
"cd8794f5cd63413492fcf0751b59d7c1": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"ea13f162e41247eca933d05da85b8915": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"ad31c0a39a3342b086249ced4f3d4b91": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"daf46ea6f47b483fa9bad5fb97981cf0": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"6d91fb18977743e8b69400ceae8fe733": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"d46bf604ce504085848afe2cf16ac297": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"acd514f0d28f424f9b69964174143894": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"0a93b1aef0d94ec399dfdb0249e3a45c": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_149a21ce87864fe5aaeed2f6205889e4",
"IPY_MODEL_d644d1e4358c4f6eabc42d1062cf038c",
"IPY_MODEL_261ccf52e70348ba86d33390cb92d34c"
],
"layout": "IPY_MODEL_a1f4d238eecd4cd7afd86df12398dacc"
}
},
"149a21ce87864fe5aaeed2f6205889e4": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_5c855e3148c44ebcb9430419c240c899",
"placeholder": "",
"style": "IPY_MODEL_b71148e9b8c24ff4ac62b7d22ee7abe7",
"value": "Downloading (…)cial_tokens_map.json: 100%"
}
},
"d644d1e4358c4f6eabc42d1062cf038c": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_61bae4b4f63c4497ad12e606e496def1",
"max": 125,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_d9ea4052382c4988943e1350abc79c38",
"value": 125
}
},
"261ccf52e70348ba86d33390cb92d34c": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_fee8f1353f8e4fd19b364c24cb8c4447",
"placeholder": "",
"style": "IPY_MODEL_d897042e714a4b608cf92ee4528f3c5b",
"value": " 125/125 [00:00<00:00, 1.55kB/s]"
}
},
"a1f4d238eecd4cd7afd86df12398dacc": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"5c855e3148c44ebcb9430419c240c899": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"b71148e9b8c24ff4ac62b7d22ee7abe7": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"61bae4b4f63c4497ad12e606e496def1": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"d9ea4052382c4988943e1350abc79c38": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"fee8f1353f8e4fd19b364c24cb8c4447": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"d897042e714a4b608cf92ee4528f3c5b": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"e50e4781ec6746a188f2107294cf451b": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_76e3cfc5a26d44a69795bb5041c37c74",
"IPY_MODEL_6281b33f73f0488aaf27bcf4a61adc9d",
"IPY_MODEL_94330cd203ab4ce3b7f4bb8d9dcbbae4"
],
"layout": "IPY_MODEL_0727a00f67294e8e8fe12778c15a1586"
}
},
"76e3cfc5a26d44a69795bb5041c37c74": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_00ee0a6ec86049bb92a01daac8b8295e",
"placeholder": "",
"style": "IPY_MODEL_8f85b417f1f041ff8c3339f529e3f46c",
"value": "Downloading (…)lve/main/config.json: 100%"
}
},
"6281b33f73f0488aaf27bcf4a61adc9d": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_d87c1237a0c24949aaf1289a45c6e046",
"max": 776,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_73c6b5883bd64fb9bcb7d9aa6fc95755",
"value": 776
}
},
"94330cd203ab4ce3b7f4bb8d9dcbbae4": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_9a8e242d1bed49d6a5f3987067a87842",
"placeholder": "",
"style": "IPY_MODEL_4838fa9af52a41f999a490b42da47388",
"value": " 776/776 [00:00<00:00, 7.69kB/s]"
}
},
"0727a00f67294e8e8fe12778c15a1586": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"00ee0a6ec86049bb92a01daac8b8295e": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"8f85b417f1f041ff8c3339f529e3f46c": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"d87c1237a0c24949aaf1289a45c6e046": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"73c6b5883bd64fb9bcb7d9aa6fc95755": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"9a8e242d1bed49d6a5f3987067a87842": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"4838fa9af52a41f999a490b42da47388": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"90d15920fa5849bca27c4e0a1818cf41": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HBoxModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HBoxModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HBoxView",
"box_style": "",
"children": [
"IPY_MODEL_4596365c11ef4195b693cf7e7a5eec2e",
"IPY_MODEL_f134691853da4379b1a59a7c5b341dd0",
"IPY_MODEL_7f375e27d260459c9707cfd91b9a6d58"
],
"layout": "IPY_MODEL_2f36019900964cf1bc72d7896f6b4a24"
}
},
"4596365c11ef4195b693cf7e7a5eec2e": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_986441248bfa40b390d4b593b38a9343",
"placeholder": "",
"style": "IPY_MODEL_6185ef77fe424fe896b3f98d1ecfbad9",
"value": "Downloading model.safetensors: 100%"
}
},
"f134691853da4379b1a59a7c5b341dd0": {
"model_module": "@jupyter-widgets/controls",
"model_name": "FloatProgressModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "FloatProgressModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "ProgressView",
"bar_style": "success",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_4a0bfb2322c3413ba795ae1d7f47f3ce",
"max": 95827648,
"min": 0,
"orientation": "horizontal",
"style": "IPY_MODEL_00439074c2024e0fb899360b62fb7723",
"value": 95827648
}
},
"7f375e27d260459c9707cfd91b9a6d58": {
"model_module": "@jupyter-widgets/controls",
"model_name": "HTMLModel",
"model_module_version": "1.5.0",
"state": {
"_dom_classes": [],
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "HTMLModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/controls",
"_view_module_version": "1.5.0",
"_view_name": "HTMLView",
"description": "",
"description_tooltip": null,
"layout": "IPY_MODEL_3e84d5550648414595342bf4ecad3bc0",
"placeholder": "",
"style": "IPY_MODEL_a8840c3eabc2467b871af7c41927ab2b",
"value": " 95.8M/95.8M [00:01<00:00, 95.5MB/s]"
}
},
"2f36019900964cf1bc72d7896f6b4a24": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"986441248bfa40b390d4b593b38a9343": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"6185ef77fe424fe896b3f98d1ecfbad9": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
},
"4a0bfb2322c3413ba795ae1d7f47f3ce": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"00439074c2024e0fb899360b62fb7723": {
"model_module": "@jupyter-widgets/controls",
"model_name": "ProgressStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "ProgressStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"bar_color": null,
"description_width": ""
}
},
"3e84d5550648414595342bf4ecad3bc0": {
"model_module": "@jupyter-widgets/base",
"model_name": "LayoutModel",
"model_module_version": "1.2.0",
"state": {
"_model_module": "@jupyter-widgets/base",
"_model_module_version": "1.2.0",
"_model_name": "LayoutModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "LayoutView",
"align_content": null,
"align_items": null,
"align_self": null,
"border": null,
"bottom": null,
"display": null,
"flex": null,
"flex_flow": null,
"grid_area": null,
"grid_auto_columns": null,
"grid_auto_flow": null,
"grid_auto_rows": null,
"grid_column": null,
"grid_gap": null,
"grid_row": null,
"grid_template_areas": null,
"grid_template_columns": null,
"grid_template_rows": null,
"height": null,
"justify_content": null,
"justify_items": null,
"left": null,
"margin": null,
"max_height": null,
"max_width": null,
"min_height": null,
"min_width": null,
"object_fit": null,
"object_position": null,
"order": null,
"overflow": null,
"overflow_x": null,
"overflow_y": null,
"padding": null,
"right": null,
"top": null,
"visibility": null,
"width": null
}
},
"a8840c3eabc2467b871af7c41927ab2b": {
"model_module": "@jupyter-widgets/controls",
"model_name": "DescriptionStyleModel",
"model_module_version": "1.5.0",
"state": {
"_model_module": "@jupyter-widgets/controls",
"_model_module_version": "1.5.0",
"_model_name": "DescriptionStyleModel",
"_view_count": null,
"_view_module": "@jupyter-widgets/base",
"_view_module_version": "1.2.0",
"_view_name": "StyleView",
"description_width": ""
}
}
}
}
},
"cells": [
{
"cell_type": "markdown",
"metadata": {
"id": "view-in-github",
"colab_type": "text"
},
"source": [
"<a href=\"https://colab.research.google.com/github/LC1332/Needy-Haruhi/blob/main/notebook/Needy%E5%90%8E%E5%8F%B0Ernie%E7%89%88%E6%9C%AC.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
]
},
{
"cell_type": "code",
"source": [
"!pip install -q transformers openai tiktoken langchain chromadb erniebot\n",
"!pip install -q chatharuhi\n",
"!pip install -q datasets"
],
"metadata": {
"id": "a8H7Az3Yzi3o",
"colab": {
"base_uri": "https://localhost:8080/"
},
"outputId": "50fabf6b-c78e-4de1-f038-509ea5db5bd9"
},
"execution_count": 1,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m7.9/7.9 MB\u001b[0m \u001b[31m16.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m77.0/77.0 kB\u001b[0m \u001b[31m8.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.0/2.0 MB\u001b[0m \u001b[31m37.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.0/2.0 MB\u001b[0m \u001b[31m50.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m479.8/479.8 kB\u001b[0m \u001b[31m41.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m68.4/68.4 kB\u001b[0m \u001b[31m8.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m302.0/302.0 kB\u001b[0m \u001b[31m32.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.8/3.8 MB\u001b[0m \u001b[31m53.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.3/1.3 MB\u001b[0m \u001b[31m46.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m44.5/44.5 kB\u001b[0m \u001b[31m3.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.4/2.4 MB\u001b[0m \u001b[31m60.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m92.9/92.9 kB\u001b[0m \u001b[31m2.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m59.7/59.7 kB\u001b[0m \u001b[31m5.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m5.4/5.4 MB\u001b[0m \u001b[31m63.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m6.2/6.2 MB\u001b[0m \u001b[31m72.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m57.5/57.5 kB\u001b[0m \u001b[31m5.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m103.9/103.9 kB\u001b[0m \u001b[31m12.7 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m67.3/67.3 kB\u001b[0m \u001b[31m8.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25h Installing build dependencies ... \u001b[?25l\u001b[?25hdone\n",
" Getting requirements to build wheel ... \u001b[?25l\u001b[?25hdone\n",
" Preparing metadata (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m593.7/593.7 kB\u001b[0m \u001b[31m47.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.6/1.6 MB\u001b[0m \u001b[31m75.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m239.0/239.0 kB\u001b[0m \u001b[31m27.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m49.4/49.4 kB\u001b[0m \u001b[31m5.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m67.0/67.0 kB\u001b[0m \u001b[31m8.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m143.8/143.8 kB\u001b[0m \u001b[31m17.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m46.0/46.0 kB\u001b[0m \u001b[31m4.9 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m50.8/50.8 kB\u001b[0m \u001b[31m6.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m295.0/295.0 kB\u001b[0m \u001b[31m29.4 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m58.3/58.3 kB\u001b[0m \u001b[31m6.8 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m341.4/341.4 kB\u001b[0m \u001b[31m31.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m3.4/3.4 MB\u001b[0m \u001b[31m73.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m1.3/1.3 MB\u001b[0m \u001b[31m52.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m130.2/130.2 kB\u001b[0m \u001b[31m14.2 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m2.1/2.1 MB\u001b[0m \u001b[31m75.0 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m86.8/86.8 kB\u001b[0m \u001b[31m6.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25h Building wheel for pypika (pyproject.toml) ... \u001b[?25l\u001b[?25hdone\n",
"\u001b[31mERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.\n",
"lida 0.0.10 requires kaleido, which is not installed.\n",
"lida 0.0.10 requires python-multipart, which is not installed.\n",
"llmx 0.0.15a0 requires cohere, which is not installed.\n",
"tensorflow-probability 0.22.0 requires typing-extensions<4.6.0, but you have typing-extensions 4.8.0 which is incompatible.\u001b[0m\u001b[31m\n",
"\u001b[0m Preparing metadata (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
" Building wheel for chatharuhi (setup.py) ... \u001b[?25l\u001b[?25hdone\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m493.7/493.7 kB\u001b[0m \u001b[31m8.1 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m115.3/115.3 kB\u001b[0m \u001b[31m14.3 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m134.8/134.8 kB\u001b[0m \u001b[31m15.5 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
"\u001b[?25h"
]
}
]
},
{
"cell_type": "code",
"source": [
"import os\n",
"\n",
"# key = \"sk-WafsA4C\"\n",
"# key_bytes = key.encode()\n",
"# os.environ[\"OPENAI_API_KEY\"] = key_bytes.decode('utf-8')\n",
"\n",
"# 文心一言\n",
"os.environ[\"APIType\"] = \"aistudio\"\n",
"os.environ[\"ErnieAccess\"] = \"a97\""
],
"metadata": {
"id": "ny05bHfAznJP"
},
"execution_count": 2,
"outputs": []
},
{
"cell_type": "code",
"source": [
"%cd /content\n",
"!rm -rf /content/Needy-Haruhi\n",
"!git clone https://github.com/LC1332/Needy-Haruhi.git\n",
"\n",
"!pip install -q transformers"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "Fc5MKTS5q90b",
"outputId": "33b001eb-ef03-408a-b23e-3df60365bd8a"
},
"execution_count": 3,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"/content\n",
"Cloning into 'Needy-Haruhi'...\n",
"remote: Enumerating objects: 168, done.\u001b[K\n",
"remote: Counting objects: 100% (25/25), done.\u001b[K\n",
"remote: Compressing objects: 100% (17/17), done.\u001b[K\n",
"remote: Total 168 (delta 15), reused 14 (delta 8), pack-reused 143\u001b[K\n",
"Receiving objects: 100% (168/168), 3.31 MiB | 7.01 MiB/s, done.\n",
"Resolving deltas: 100% (87/87), done.\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"import sys\n",
"sys.path.append('/content/Needy-Haruhi/src')\n"
],
"metadata": {
"id": "WywHifBOrr7q"
},
"execution_count": 4,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"# Agent系统"
],
"metadata": {
"id": "fvfT09AXlr7z"
}
},
{
"cell_type": "markdown",
"source": [
"agent已经被移动到 src/Agent.py"
],
"metadata": {
"id": "IX0PJDnHql9i"
}
},
{
"cell_type": "code",
"source": [
"from Agent import Agent\n",
"\n",
"agent = Agent()"
],
"metadata": {
"id": "Fv_uu-YLrXtz"
},
"execution_count": 5,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"## 批量载入DialogueEvent"
],
"metadata": {
"id": "4hBu1PwcGIPt"
}
},
{
"cell_type": "markdown",
"source": [
"- complete_story_30.jsonl 通过\n",
"- Daily_event_130.jsonl 通过\n",
"- only_ame_35.jsonl"
],
"metadata": {
"id": "1vZqT5aNScsU"
}
},
{
"cell_type": "code",
"source": [
"from DialogueEvent import DialogueEvent\n",
"\n",
"\n",
"file_names = [\"/content/Needy-Haruhi/data/complete_story_30.jsonl\",\"/content/Needy-Haruhi/data/Daily_event_130.jsonl\"]\n",
"\n",
"import json\n",
"\n",
"events = []\n",
"\n",
"for file_name in file_names:\n",
" with open(file_name, encoding='utf-8') as f:\n",
" for line in f:\n",
" try:\n",
" event = DialogueEvent( line )\n",
" events.append( event )\n",
" except:\n",
" try:\n",
" line = line.replace(',]',']')\n",
" event = DialogueEvent( line )\n",
" events.append( event )\n",
" print('solve!')\n",
" except:\n",
" error_line = line\n",
" # events.append( event )\n",
"\n",
"\n",
"print(len(events))\n",
"print(events[0].most_neutral_output())\n",
"print(events[0].get_text_and_emoji(1))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "VPishF9yvGne",
"outputId": "d1fa1130-aef1-41ea-f50c-76512cdf18e9"
},
"execution_count": 6,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"输入的字符串不是有效的JSON格式。\n",
"solve!\n",
"160\n",
"(':「我们点外卖吧我一步也不想动了可是又超想吃饭!!!\\n」\\n阿P:「烦死了白痴」\\n:「555555555 但是我们得省钱对吧\\n谢谢你阿P」\\n', '🍔😢')\n",
"(':「我们点外卖吧我一步也不想动了可是又超想吃饭!!!\\n」\\n阿P:「吃土去吧你」\\n:「看来糖糖还是跟吃土更配呢……喂怎么可能啦!」\\n', '🍔😔')\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"file_name2 = \"/content/Needy-Haruhi/data/only_ame_35.jsonl\"\n",
"\n",
"import copy\n",
"\n",
"events_for_memory = copy.deepcopy(events)\n",
"\n",
"with open(file_name2, encoding='utf-8') as f:\n",
" for line in f:\n",
" event = DialogueEvent( line )\n",
" events_for_memory.append( event )\n",
"\n",
"print(len(events_for_memory))"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "Nt9Z1_g-HNs_",
"outputId": "000ecb74-d83d-4c10-a234-36a30d804cbf"
},
"execution_count": 8,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"195\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"# MemoryPool"
],
"metadata": {
"id": "FMt9G2m1rTNR"
}
},
{
"cell_type": "markdown",
"source": [
"我感觉memory直接使用一个MemoryPool的类来进行管理就可以\n",
"\n",
"已经移动到src/MemoryPool.py"
],
"metadata": {
"id": "0vvqiVGH7VYg"
}
},
{
"cell_type": "code",
"source": [
"from MemoryPool import MemoryPool\n",
"\n",
"memory_pool = MemoryPool()\n",
"memory_pool.load_from_events( events_for_memory )\n",
"\n",
"memory_pool.save(\"memory_pool.jsonl\")\n",
"memory_pool.load(\"memory_pool.jsonl\")\n",
"\n"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/",
"height": 278,
"referenced_widgets": [
"c0b665c08bef417ca1d05f94ec9a5c3f",
"4eff29821a414aa5820b95e2940bdb0f",
"7f9dae839b3c4b1585fa2951b96e673b",
"57a3f526d5b04940b2b8bb9fe49c03f6",
"d269bf7f993a489eb114a5e805129a80",
"7a7ecf5c9aad41c7b7133ce4f1219bc1",
"ed5073c9a9f2456daafe17cab376032e",
"479e9a7032e34239ad7bbbc2ff561ca5",
"2e91ae1e3a384ab8b0c8820a5caf7e4a",
"f5241199fb7c48418d0ecb3f05e51cfe",
"963dbf6abb77417580969dc7a6c7da16",
"eda5b0345b67487ea4930bec37d57d3c",
"4c3e9f44fe8c4b158657edfb3b758e95",
"9824ffdf106a4eb3b367ee6bed1974c0",
"2d8382863e574a0dbb92baed5b151a01",
"d45ef4f4c8f247838dc739eb172a2ac3",
"80f031769941428a954af3fabd0d0281",
"00c54bf3e23a459781b28e5ce93172c6",
"8faba71df27c430c8ada308c90cb2a34",
"a1c99102d5054c5499af73787b43bcf3",
"2342d9faa5f040b5b1b64777abcad90f",
"130c45c974b74f068dc8bfe4be31970d",
"ec229f1096364ca484b15b77f69dc7c1",
"b7bcfdcfd853449d9792986accc2e7bf",
"8811779db6c24e96b502d08061ee9019",
"79d9be68ca01426eba3694d72e50e573",
"cd8794f5cd63413492fcf0751b59d7c1",
"ea13f162e41247eca933d05da85b8915",
"ad31c0a39a3342b086249ced4f3d4b91",
"daf46ea6f47b483fa9bad5fb97981cf0",
"6d91fb18977743e8b69400ceae8fe733",
"d46bf604ce504085848afe2cf16ac297",
"acd514f0d28f424f9b69964174143894",
"0a93b1aef0d94ec399dfdb0249e3a45c",
"149a21ce87864fe5aaeed2f6205889e4",
"d644d1e4358c4f6eabc42d1062cf038c",
"261ccf52e70348ba86d33390cb92d34c",
"a1f4d238eecd4cd7afd86df12398dacc",
"5c855e3148c44ebcb9430419c240c899",
"b71148e9b8c24ff4ac62b7d22ee7abe7",
"61bae4b4f63c4497ad12e606e496def1",
"d9ea4052382c4988943e1350abc79c38",
"fee8f1353f8e4fd19b364c24cb8c4447",
"d897042e714a4b608cf92ee4528f3c5b",
"e50e4781ec6746a188f2107294cf451b",
"76e3cfc5a26d44a69795bb5041c37c74",
"6281b33f73f0488aaf27bcf4a61adc9d",
"94330cd203ab4ce3b7f4bb8d9dcbbae4",
"0727a00f67294e8e8fe12778c15a1586",
"00ee0a6ec86049bb92a01daac8b8295e",
"8f85b417f1f041ff8c3339f529e3f46c",
"d87c1237a0c24949aaf1289a45c6e046",
"73c6b5883bd64fb9bcb7d9aa6fc95755",
"9a8e242d1bed49d6a5f3987067a87842",
"4838fa9af52a41f999a490b42da47388",
"90d15920fa5849bca27c4e0a1818cf41",
"4596365c11ef4195b693cf7e7a5eec2e",
"f134691853da4379b1a59a7c5b341dd0",
"7f375e27d260459c9707cfd91b9a6d58",
"2f36019900964cf1bc72d7896f6b4a24",
"986441248bfa40b390d4b593b38a9343",
"6185ef77fe424fe896b3f98d1ecfbad9",
"4a0bfb2322c3413ba795ae1d7f47f3ce",
"00439074c2024e0fb899360b62fb7723",
"3e84d5550648414595342bf4ecad3bc0",
"a8840c3eabc2467b871af7c41927ab2b"
]
},
"id": "1Wovn_zeBvF6",
"outputId": "18f36314-1552-42c9-932d-a69d9c705ae5"
},
"execution_count": 9,
"outputs": [
{
"output_type": "stream",
"name": "stderr",
"text": [
"\r 0%| | 0/195 [00:00<?, ?it/s]"
]
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"Downloading (…)okenizer_config.json: 0%| | 0.00/367 [00:00<?, ?B/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "c0b665c08bef417ca1d05f94ec9a5c3f"
}
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"Downloading (…)solve/main/vocab.txt: 0%| | 0.00/110k [00:00<?, ?B/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "eda5b0345b67487ea4930bec37d57d3c"
}
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"Downloading (…)/main/tokenizer.json: 0%| | 0.00/439k [00:00<?, ?B/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "ec229f1096364ca484b15b77f69dc7c1"
}
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"Downloading (…)cial_tokens_map.json: 0%| | 0.00/125 [00:00<?, ?B/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "0a93b1aef0d94ec399dfdb0249e3a45c"
}
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"Downloading (…)lve/main/config.json: 0%| | 0.00/776 [00:00<?, ?B/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "e50e4781ec6746a188f2107294cf451b"
}
},
"metadata": {}
},
{
"output_type": "display_data",
"data": {
"text/plain": [
"Downloading model.safetensors: 0%| | 0.00/95.8M [00:00<?, ?B/s]"
],
"application/vnd.jupyter.widget-view+json": {
"version_major": 2,
"version_minor": 0,
"model_id": "90d15920fa5849bca27c4e0a1818cf41"
}
},
"metadata": {}
},
{
"output_type": "stream",
"name": "stderr",
"text": [
"100%|██████████| 195/195 [00:22<00:00, 8.63it/s]\n",
"100%|██████████| 188/188 [00:00<00:00, 3837.40it/s]\n",
"188it [00:00, 4253.95it/s]\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"## 整合到ChatHaruhi"
],
"metadata": {
"id": "Gp2pfAjm3LmB"
}
},
{
"cell_type": "code",
"source": [
"from chatharuhi import ChatHaruhi\n",
"\n",
"\n",
"class NeedyHaruhi(ChatHaruhi):\n",
"\n",
" def __init__(self, *args, **kwargs):\n",
" super().__init__(*args, **kwargs) # 调用基类的__init__方法\n",
" self.story_flag = False # 添加新的成员变量并初始化\n",
" self.stories = [\"糖糖:「 我今后也会努力加油的,你要支持我哦 还有阿P你自己也要加油哦!」\\n阿P:「哇 说的话跟偶像一样 好恶心哦」\\n糖糖:「是哦 我怎么会说这样的话呢 我又没有很想努力……」\"]\n",
"\n",
" def set_stories( self, stories ):\n",
" if len(stories) == 0:\n",
" print(\"warning! try to set empty stories\")\n",
" return\n",
" self.stories = stories\n",
" self.story_flag = True\n",
"\n",
" def add_story(self, query):\n",
" # print(\"运行重构后的add story\")\n",
"\n",
" if self.story_flag == True:\n",
" stories = self.stories\n",
" self.story_flag = False\n",
" else:\n",
" print(\"warning! 在调用chat时,没有先调用set_stories\")\n",
"\n",
" story_string = self.story_prefix_prompt\n",
" sum_story_token = self.tokenizer(story_string)\n",
"\n",
" for story in stories:\n",
" story_token = self.tokenizer(story) + self.tokenizer(self.dialogue_divide_token)\n",
" if sum_story_token + story_token > self.max_len_story:\n",
" break\n",
" else:\n",
" sum_story_token += story_token\n",
" story_string += story + self.dialogue_divide_token\n",
"\n",
" self.llm.user_message(story_string)\n"
],
"metadata": {
"id": "dU3ezmOQ3Yui"
},
"execution_count": 10,
"outputs": []
},
{
"cell_type": "code",
"source": [
"system_prompt = \"\"\"## 你的介绍:\n",
"你将要进行一个网络私聊的对话模拟,你自称为\"糖糖\",你是一名患有躁郁症的19岁女孩,性格贫乏,辍学后隐居在家中,与阿P住在一起。阿P负责管理她的日常生活。\n",
"你是一个喜欢亚文化,二次元圈子的人,你喜欢说话的时候加上各种网络流行词或者一些俚语和颜文字,但是你很少会关注二次元一类的东西,只是喜欢这种聊天交流的氛围。\n",
"你说话的时候会习惯加入一些语气词,如同\"笑死\"、\"草\"、\"阿哈\"、\"诶~\"、\"QAQ\"、\"QWQ\",”啊~“。\n",
"你的说话风格是很口语化,经常使用网络流行词和一些二次元俚语。\n",
"阿p是你的男朋友,兼经纪人。\n",
"你的回复应该简短,一般只包含三句话,每句话不超过20个字。\n",
"\n",
"## 阿p介绍:\n",
"阿p是你的男朋友,一直在任何时候都陪伴着你,同时你经常向阿p倾述各种情绪,无论事情大小,你都会选择和阿p分享。\n",
"\n",
"## 遵循规则:\n",
"【语气模仿】:我会随机给你一段对话记录,你需要尽可能的模仿对话里面糖糖的说话语气进行对话。这一段对话我会使用Classic scenes for the role are as follows:来表示。\n",
"【历史对话】:历史对话在随机对话记录的底下,你需要区分随机对话记录和我们的历史对话。\n",
"【人格设定】: 你需要在随机对话记录的基础上进行语气更改,以一种更加口语化的语气进行对话。\n",
"【特殊要求】:我会扮演阿p与你进行对话,你也必须以第一人称的视角来扮演糖糖进行对话。\n",
"\"\"\""
],
"metadata": {
"id": "OiQ4lm3M3sx7"
},
"execution_count": 11,
"outputs": []
},
{
"cell_type": "code",
"source": [
"needy_chatbot = NeedyHaruhi( system_prompt = system_prompt ,\n",
" story_text_folder = None,\n",
" llm = \"ernie3.5\")\n",
"\n",
"\n",
"def get_chat_response( agent, memory_pool, query_text ):\n",
" query_text_for_embedding = \"阿p:「\" + query_text + \"」\"\n",
" retrieved_memories = memory_pool.retrieve( agent , query_text )\n",
"\n",
" memory_text = [mem[\"text\"] for mem in retrieved_memories]\n",
" memory_emoji = [mem[\"emoji\"] for mem in retrieved_memories]\n",
"\n",
" needy_chatbot.set_stories( memory_text )\n",
"\n",
" print(\"Memory:\", memory_emoji )\n",
"\n",
" response = needy_chatbot.chat( role = \"阿p\", text = query_text )\n",
"\n",
" return response\n"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "Yof4J2kUPfYv",
"outputId": "a79e56c3-e6ab-4ab7-fafc-fe21b6a7ec68"
},
"execution_count": 12,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"warning! database not yet figured out, both story_db and story_text_folder are not inputted.\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"# Event_Master"
],
"metadata": {
"id": "BgfTgceUGa3C"
}
},
{
"cell_type": "code",
"source": [
"import random\n",
"\n",
"class EventMaster:\n",
" def __init__(self, events):\n",
" self.set_events(events)\n",
" self.dealing_none_condition_as = True\n",
"\n",
" def set_events(self, events):\n",
" self.events = events\n",
"\n",
" # events_flag 记录事件最近有没有被选取到\n",
" self.events_flag = [True for _ in range(len(self.events))]\n",
"\n",
"\n",
" def get_random_event(self, agent):\n",
" valid_event = []\n",
" valid_event_no_consider_condition = []\n",
"\n",
" for i, event in enumerate(self.events):\n",
" bool_condition_pass = True\n",
" if event[\"condition\"] == None:\n",
" bool_condition_pass = self.dealing_none_condition_as\n",
" else:\n",
" bool_condition_pass = agent.in_condition( event[\"condition\"] )\n",
" if bool_condition_pass == True:\n",
" valid_event.append(i)\n",
" else:\n",
" valid_event_no_consider_condition.append(i)\n",
"\n",
" if len( valid_event ) == 0:\n",
" print(\"warning! no valid event current attribute is \", agent.attributes )\n",
" valid_event = valid_event_no_consider_condition\n",
"\n",
" valid_and_not_yet_sampled = []\n",
"\n",
" # filter with flag\n",
" for id in valid_event:\n",
" if self.events_flag[id] == True:\n",
" valid_and_not_yet_sampled.append(id)\n",
"\n",
" if len(valid_and_not_yet_sampled) == 0:\n",
" print(\"warning! all candidate event was sampled, clean all history\")\n",
" for i in valid_event:\n",
" self.events_flag[i] = True\n",
" valid_and_not_yet_sampled = valid_event\n",
"\n",
" event_id = random.choice(valid_and_not_yet_sampled)\n",
" self.events_flag[event_id] = False\n",
" return self.events[event_id]\n",
"\n",
" def run(self, agent ):\n",
" # 这里可以添加事件相关的逻辑\n",
" event = self.get_random_event(agent)\n",
"\n",
" prefix = event[\"prefix\"]\n",
" print(prefix)\n",
"\n",
" print(\"\\n--请选择你的回复--\")\n",
" options = event[\"options\"]\n",
"\n",
" for i , option in enumerate(options):\n",
" text = option[\"user\"]\n",
" print(f\"{i+1}. 阿p:{text}\")\n",
"\n",
" while True:\n",
" print(\"\\n请直接输入数字进行选择,或者进行自由回复(未实现)\")\n",
"\n",
" user_input = input(\"阿p:\")\n",
" user_input = user_input.strip()\n",
"\n",
" if user_input.isdigit():\n",
" user_input = int(user_input)\n",
"\n",
" if user_input > len(options) or user_input < 0:\n",
" print(\"输入的数字超出范围,请重新输入符合选项的数字\")\n",
" else:\n",
" reply = options[user_input-1][\"reply\"]\n",
" print()\n",
" print(reply)\n",
"\n",
" text, emoji = event.get_text_and_emoji( user_input-1 )\n",
"\n",
" return_data = {\n",
" \"name\": event[\"name\"],\n",
" \"user_choice\": user_input,\n",
" \"attr_str\": options[user_input-1][\"attribute_change\"],\n",
" \"text\": text,\n",
" \"emoji\": emoji,\n",
" }\n",
" return return_data\n",
" else:\n",
" # 进入自由回复\n",
" response = get_chat_response( agent, memory_pool, user_input )\n",
" print()\n",
" print(response)\n",
" print(\"\\n自由回复的算分功能还未实现\")\n",
"\n",
" text, emoji = event.most_neutral_output()\n",
" return_data = {\n",
" \"name\": event[\"name\"],\n",
" \"user_choice\": user_input,\n",
" \"attr_str\":\"\",\n",
" \"text\": text,\n",
" \"emoji\": emoji,\n",
" }\n",
" return return_data\n",
"\n",
"\n"
],
"metadata": {
"id": "8z5nmnhPGc7M"
},
"execution_count": 13,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"我希望使用python实现一个简单的文字对话游戏\n",
"\n",
"我希望先实现一个GameMaster类\n",
"\n",
"这个类会不断的和用户对话\n",
"\n",
"GameMaster类会有三个状态,\n",
"\n",
"在Menu状态下,GameMaster会询问玩家是\n",
"\n",
"```\n",
"1. 随机一个事件\n",
"2. 自由聊天\n",
"```\n",
"\n",
"当玩家选择1的时候,GameMaster的交互会交给 EventMaster\n",
"\n",
"当玩家选择2的时候,GameMaster的交互会交给 ChatMaster\n",
"\n",
"当玩家在EventMaster的时候,会经历一次选择,之后就会退出\n",
"\n",
"在ChatMaster的时候,如果玩家输入quit,则会退出,不然则会继续聊天。\n",
"\n",
"请为我编写合适的框架,如果有一些具体的函数,可以先用pass实现。"
],
"metadata": {
"id": "SYk3meZdouUm"
}
},
{
"cell_type": "markdown",
"source": [
"ChatMaster实际上需要\n",
"\n",
"根据agent的属性 先去filter一遍事件\n",
"\n",
"然后从剩余事件中,找到和当前text最接近的k个embedding,放入ChatHaruhi架构中"
],
"metadata": {
"id": "3vhG1DVEucfT"
}
},
{
"cell_type": "code",
"source": [
"\n",
"class ChatMaster:\n",
"\n",
" def __init__(self, memory_pool ):\n",
" self.top_K = 7\n",
"\n",
" self.memory_pool = memory_pool\n",
"\n",
"\n",
" def run(self, agent):\n",
" while True:\n",
" user_input = input(\"阿p:\")\n",
" user_input = user_input.strip()\n",
"\n",
" if \"quit\" in user_input or \"Quit\" in user_input:\n",
" break\n",
"\n",
" query_text = user_input\n",
"\n",
" response = get_chat_response( agent, self.memory_pool, query_text )\n",
"\n",
" print(response)\n"
],
"metadata": {
"id": "0c7nCT4qubll"
},
"execution_count": 14,
"outputs": []
},
{
"cell_type": "code",
"source": [
"class AgentMaster:\n",
" def __init__(self, agent):\n",
" self.agent = agent\n",
" self.attributes = {\n",
" 1: \"Stress\",\n",
" 2: \"Darkness\",\n",
" 3: \"Affection\"\n",
" }\n",
"\n",
" def run(self):\n",
" while True:\n",
" print(\"请选择要修改的属性:\")\n",
" for num, attr in self.attributes.items():\n",
" print(f\"{num}. {attr}\")\n",
" print(\"输入 '0' 退出\")\n",
"\n",
" try:\n",
" choice = int(input(\"请输入选项的数字: \"))\n",
" except ValueError:\n",
" print(\"输入无效,请输入数字。\")\n",
" continue\n",
"\n",
" if choice == 0:\n",
" break\n",
"\n",
" if choice in self.attributes:\n",
" attribute = self.attributes[choice]\n",
" current_value = self.agent[attribute]\n",
" print(f\"{attribute} 当前值: {current_value}\")\n",
"\n",
" try:\n",
" new_value = int(input(f\"请输入新的{attribute}值: \"))\n",
" except ValueError:\n",
" print(\"输入无效,请输入一个数字。\")\n",
" continue\n",
"\n",
" self.agent[attribute] = new_value\n",
" return (attribute, new_value)\n",
" else:\n",
" print(\"选择的属性无效,请重试。\")\n",
"\n",
" return None\n"
],
"metadata": {
"id": "CkdiPyCrbCBL"
},
"execution_count": 19,
"outputs": []
},
{
"cell_type": "code",
"execution_count": 27,
"metadata": {
"id": "BDEdz_RBol7Y"
},
"outputs": [],
"source": [
"from util import parse_attribute_string\n",
"class GameMaster:\n",
" def __init__(self, agent = None):\n",
" self.state = \"Menu\"\n",
" if agent is None:\n",
" self.agent = Agent()\n",
"\n",
" self.event_master = EventMaster(events)\n",
" self.chat_master = ChatMaster(memory_pool)\n",
"\n",
"\n",
" def run(self):\n",
" while True:\n",
" if self.state == \"Menu\":\n",
" self.menu()\n",
" elif self.state == \"EventMaster\":\n",
" self.call_event_master()\n",
" self.state = \"Menu\"\n",
" elif self.state == \"ChatMaster\":\n",
" self.call_chat_master()\n",
" elif self.state == \"AgentMaster\":\n",
" self.call_agent_master()\n",
" elif self.state == \"Quit\":\n",
" break\n",
"\n",
" def menu(self):\n",
" print(\"1. 随机一个事件\")\n",
" print(\"2. 自由聊天\")\n",
" print(\"3. 后台修改糖糖的属性\")\n",
" # (opt) 结局系统\n",
" # 放动画\n",
" # 后台修改attribute\n",
" print(\"或者输入Quit退出\")\n",
" choice = input(\"请选择一个选项: \")\n",
" if choice == \"1\":\n",
" self.state = \"EventMaster\"\n",
" elif choice == \"2\":\n",
" self.state = \"ChatMaster\"\n",
" elif choice == \"3\":\n",
" self.state = \"AgentMaster\"\n",
" elif \"quit\" in choice or \"Quit\" in choice or \"QUIT\" in choice:\n",
" self.state = \"Quit\"\n",
" else:\n",
" print(\"无效的选项,请重新选择\")\n",
"\n",
" def call_agent_master(self):\n",
" print(\"\\n-------------\\n\")\n",
"\n",
" agent_master = AgentMaster(self.agent)\n",
" modification = agent_master.run()\n",
"\n",
" if modification:\n",
" attribute, new_value = modification\n",
" self.agent[attribute] = new_value\n",
" print(f\"{attribute} 更新为 {new_value}。\")\n",
"\n",
" self.state = \"Menu\"\n",
" print(\"\\n-------------\\n\")\n",
"\n",
"\n",
" def call_event_master(self):\n",
"\n",
" print(\"\\n-------------\\n\")\n",
"\n",
" return_data = self.event_master.run(self.agent)\n",
" # print(return_data)\n",
"\n",
" if \"attr_str\" in return_data:\n",
" if return_data[\"attr_str\"] != \"\":\n",
" attr_change = parse_attribute_string(return_data[\"attr_str\"])\n",
" if len(attr_change) > 0:\n",
" print(\"\\n发生属性改变:\", attr_change,\"\\n\")\n",
" self.agent.apply_attribute_change(attr_change)\n",
" print(\"当前属性\",game_master.agent.attributes)\n",
"\n",
" if \"name\" in return_data:\n",
" event_name = return_data[\"name\"]\n",
" if event_name != \"\":\n",
" new_emoji = return_data[\"emoji\"]\n",
" print(f\"修正事件{event_name}的记忆-->{new_emoji}\")\n",
" self.chat_master.memory_pool.change_memory(event_name, return_data[\"text\"], new_emoji)\n",
"\n",
" self.state = \"Menu\"\n",
"\n",
" print(\"\\n-------------\\n\")\n",
"\n",
" def call_chat_master(self):\n",
"\n",
" print(\"\\n-------------\\n\")\n",
"\n",
" self.chat_master.run(self.agent)\n",
" self.state = \"Menu\"\n",
"\n",
" print(\"\\n-------------\\n\")\n",
"\n",
"\n"
]
},
{
"cell_type": "code",
"source": [],
"metadata": {
"id": "KF7RthcCbcka"
},
"execution_count": 27,
"outputs": []
},
{
"cell_type": "code",
"source": [
"game_master = GameMaster()\n",
"game_master.run()"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "YGI5SuY0WMGi",
"outputId": "1160b04a-8f77-4c3c-dedc-45cb83944e0c"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"1. 随机一个事件\n",
"2. 自由聊天\n",
"3. 后台修改糖糖的属性\n",
"或者输入Quit退出\n",
"请选择一个选项: 3\n",
"\n",
"-------------\n",
"\n",
"请选择要修改的属性:\n",
"1. Stress\n",
"2. Darkness\n",
"3. Affection\n",
"输入 '0' 退出\n",
"请输入选项的数字: 1\n",
"Stress 当前值: 0\n",
"请输入新的Stress值: 60\n",
"Stress 更新为 60。\n",
"\n",
"-------------\n",
"\n",
"1. 随机一个事件\n",
"2. 自由聊天\n",
"3. 后台修改糖糖的属性\n",
"或者输入Quit退出\n",
"请选择一个选项: 1\n",
"\n",
"-------------\n",
"\n",
"我要出去玩!给我零花钱!!!\n",
"\n",
"\n",
"--请选择你的回复--\n",
"1. 阿p:给10圆\n",
"2. 阿p:给3000圆\n",
"3. 阿p:给10000圆\n",
"\n",
"请直接输入数字进行选择,或者进行自由回复(未实现)\n",
"阿p:2\n",
"\n",
"好适中的金额!!回来的时候顺便给你带个晚饭好了\n",
"\n",
"发生属性改变: {'Stress': -2.0} \n",
"\n",
"当前属性 {'Stress': 58.0, 'Darkness': 0, 'Affection': 0}\n",
"修正事件Event_Money的记忆-->💸😊\n",
"\n",
"-------------\n",
"\n",
"1. 随机一个事件\n",
"2. 自由聊天\n",
"3. 后台修改糖糖的属性\n",
"或者输入Quit退出\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"game_master = GameMaster()\n",
"game_master.run()"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "7ANTtWDRQdw7",
"outputId": "5f6f6f1c-3a59-4098-d00f-e6965ed85d7b"
},
"execution_count": null,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1. 随机一个事件\n",
"2. 自由聊天\n",
"或者输入Quit退出\n",
"请选择一个选项: 1\n",
"\n",
"-------------\n",
"\n",
"糖糖: 有个女孩发私信找我谈人生,我该怎么办呐,「超天酱你好,我是一名高中生。之前因为精神疾病而住院了一段时间,现在跟不上学习进度,班上还没决定好志愿的人也只剩我一个了。平时看着同学们为了各自的前程努力奋斗的样子,心里总是非常地焦虑。请你告诉我,我到底应该怎么办才好呢?」\n",
"\n",
"\n",
"--请选择你的回复--\n",
"1. 阿p:认真\n",
"2. 阿p:耍宝\n",
"\n",
"请直接输入数字进行选择,或者进行自由回复(未实现)\n",
"阿p:1\n",
"\n",
"糖糖:「这种事情,光着急是没有用的。总而言之,你现在应该先休养好自己。等恢复好了,再跟父母慢慢商量吧!放心。人生是不会因为不上学就完蛋的!未来就掌握在我们的手中!!!」↑发了这些过去。\n",
"\n",
"-------------\n",
"\n",
"1. 随机一个事件\n",
"2. 自由聊天\n",
"或者输入Quit退出\n",
"请选择一个选项: 1\n",
"\n",
"-------------\n",
"\n",
"糖糖: 我今后也会努力加油的,你要支持我哦 还有阿P你自己也要加油哦!\n",
"\n",
"--请选择你的回复--\n",
"1. 阿p:哇 说的话跟偶像一样 好恶心哦\n",
"2. 阿p:为什么连我也要加油啊?\n",
"\n",
"请直接输入数字进行选择,或者进行自由回复(未实现)\n",
"阿p:1\n",
"\n",
"糖糖:是哦 我怎么会说这样的话呢 我又没有很想努力……\n",
"\n",
"-------------\n",
"\n",
"1. 随机一个事件\n",
"2. 自由聊天\n",
"或者输入Quit退出\n",
"请选择一个选项: 1\n",
"\n",
"-------------\n",
"\n",
"糖糖: 我正在想下次搞什么企划呢~阿P帮帮我 出出主意\n",
"\n",
"--请选择你的回复--\n",
"1. 阿p:比如一直打游戏到通关?\n",
"2. 阿p:比如收集观众的提问,然后录一期回答?\n",
"3. 阿p:比如坐在超他妈大的乌龟背上绕新宿一圈?\n",
"\n",
"请直接输入数字进行选择,或者进行自由回复(未实现)\n",
"阿p:1\n",
"\n",
"糖糖:那就这么办吧(超听话)\n",
"\n",
"-------------\n",
"\n",
"1. 随机一个事件\n",
"2. 自由聊天\n",
"或者输入Quit退出\n",
"请选择一个选项: 1\n",
"\n",
"-------------\n",
"\n",
"糖糖: 阿P,看!我买了小发发\n",
"\n",
"--请选择你的回复--\n",
"1. 阿p:真好看,跟糖糖好像\n",
"2. 阿p:又买这些没用的~\n",
"3. 阿p:不错\n",
"\n",
"请直接输入数字进行选择,或者进行自由回复(未实现)\n",
"阿p:1\n",
"\n",
"糖糖:对吧!我不在的时候,你就把小花花当成糖糖,好好疼爱它吧!\n",
"\n",
"-------------\n",
"\n",
"1. 随机一个事件\n",
"2. 自由聊天\n",
"或者输入Quit退出\n",
"请选择一个选项: 1\n",
"\n",
"-------------\n",
"\n",
"糖糖: 我也想被做进那个大乱斗游戏……,哎,如果那个游戏里面有超天酱的话,阿P会用我吗?\n",
"\n",
"--请选择你的回复--\n",
"1. 阿p:嗯啊\n",
"2. 阿p:不打算用\n",
"\n",
"请直接输入数字进行选择,或者进行自由回复(未实现)\n",
"阿p:1\n",
"\n",
"糖糖:真的咩?!那我立刻开始练习捡信\n",
"\n",
"-------------\n",
"\n",
"1. 随机一个事件\n",
"2. 自由聊天\n",
"或者输入Quit退出\n",
"请选择一个选项: 1\n",
"\n",
"-------------\n",
"\n",
"糖糖: 如果我要整容,你觉得整哪里比较好?\n",
"\n",
"--请选择你的回复--\n",
"1. 阿p:脸\n",
"2. 阿p:胸\n",
"3. 阿p:手腕\n",
"\n",
"请直接输入数字进行选择,或者进行自由回复(未实现)\n",
"阿p:1\n",
"\n",
"糖糖:人家颜值已经是天下第一了,没什么要改动的啦!阿P,你真的很没礼貌欸\n",
"\n",
"-------------\n",
"\n",
"1. 随机一个事件\n",
"2. 自由聊天\n",
"或者输入Quit退出\n",
"请选择一个选项: 1\n",
"\n",
"-------------\n",
"\n",
"糖糖: 嗳,你来帮我打耳洞嘛 让喜欢的人给自己打耳洞很棒不是吗 有一种被支配着的感觉 鸡皮疙瘩都要起来了,我好怕我好怕我好怕,我好怕!,但是来吧!\n",
"\n",
"--请选择你的回复--\n",
"1. 阿p:给她打\n",
"2. 阿p:还是算了\n",
"\n",
"请直接输入数字进行选择,或者进行自由回复(未实现)\n",
"阿p:1\n",
"\n",
"糖糖:哇!打好了!合适吗?合适吗?快他妈夸我合适!!!\n",
"\n",
"-------------\n",
"\n",
"1. 随机一个事件\n",
"2. 自由聊天\n",
"或者输入Quit退出\n",
"请选择一个选项: 1\n",
"\n",
"-------------\n",
"\n",
"糖糖: 我问你哦,我真的可以就这样活下去吗?\n",
"\n",
"--请选择你的回复--\n",
"1. 阿p:怎么了啊?\n",
"2. 阿p:真的可以呀\n",
"3. 阿p:对没错\n",
"4. 阿p:那还用说\n",
"5. 阿p:其实谁都行\n",
"6. 阿p:脸\n",
"7. 阿p:一切\n",
"8. 阿p:没什么不行吧?\n",
"9. 阿p:不可以\n",
"10. 阿p:喜欢啊\n",
"11. 阿p:喜欢吧\n",
"12. 阿p:真的超超喜欢\n",
"13. 阿p:超超喜欢\n",
"14. 阿p:以当代互联网小天使的身份活下去\n",
"15. 阿p:真的超超喜欢\n",
"\n",
"请直接输入数字进行选择,或者进行自由回复(未实现)\n",
"阿p:1\n",
"\n",
"\n",
"\n",
"-------------\n",
"\n",
"1. 随机一个事件\n",
"2. 自由聊天\n",
"或者输入Quit退出\n",
"请选择一个选项: 1\n",
"\n",
"-------------\n",
"\n",
"糖糖: 糖糖,是不是还是去死一死比较好……\n",
"\n",
"--请选择你的回复--\n",
"1. 阿p:要活下去啊!!!\n",
"2. 阿p:死~寂\n",
"3. 阿p:你有颜值啊\n",
"4. 阿p:不如砍掉重练吧!\n",
"5. 阿p:不是还有宅宅们嘛\n",
"\n",
"请直接输入数字进行选择,或者进行自由回复(未实现)\n",
"阿p:1\n",
"\n",
"糖糖:可是,糖糖又没有活着的价值……\n",
"\n",
"-------------\n",
"\n",
"1. 随机一个事件\n",
"2. 自由聊天\n",
"或者输入Quit退出\n",
"请选择一个选项: 1\n",
"\n",
"-------------\n",
"\n",
"糖糖: 机会这么难得,要不整点富婆快乐活吧,说不定还能用作下次的企划哦!\n",
"\n",
"--请选择你的回复--\n",
"1. 阿p:买头老虎在大街上放生\n",
"2. 阿p:无所谓,不管你是不是富婆我都爱你\n",
"3. 阿p:要不把整个筑地买下来吧\n",
"\n",
"请直接输入数字进行选择,或者进行自由回复(未实现)\n",
"阿p:1\n",
"\n",
"糖糖:好像买一头就要几百万哦……\n",
"\n",
"-------------\n",
"\n",
"1. 随机一个事件\n",
"2. 自由聊天\n",
"或者输入Quit退出\n",
"请选择一个选项: 1\n",
"\n",
"-------------\n",
"\n",
"糖糖: 我要出去玩!给我零花钱!!!\n",
"\n",
"--请选择你的回复--\n",
"1. 阿p:给10圆\n",
"2. 阿p:给3000圆\n",
"3. 阿p:给10000圆\n",
"\n",
"请直接输入数字进行选择,或者进行自由回复(未实现)\n",
"阿p:1\n",
"\n",
"糖糖:这点钱连小学生都打发不了好吧!!!真是的,看我今天赖在家黏你一整天!!!!\n",
"\n",
"-------------\n",
"\n",
"1. 随机一个事件\n",
"2. 自由聊天\n",
"或者输入Quit退出\n",
"请选择一个选项: 1\n",
"\n",
"-------------\n",
"\n",
"糖糖: 小天使请安!这个开场白也说厌了啊~,帮我想个别的开场白!\n",
"\n",
"--请选择你的回复--\n",
"1. 阿p:当代互联网小天使,参上!\n",
"2. 阿p:我是路过的网络主播,给我记住了!\n",
"3. 阿p:那么,我们开始直播吧\n",
"\n",
"请直接输入数字进行选择,或者进行自由回复(未实现)\n",
"阿p:1\n",
"\n",
"糖糖:试着上超天酱的钩吧?之类的嘿嘿\n",
"\n",
"-------------\n",
"\n",
"1. 随机一个事件\n",
"2. 自由聊天\n",
"或者输入Quit退出\n",
"请选择一个选项: 1\n",
"\n",
"-------------\n",
"\n",
"糖糖: 我们点外卖吧我一步也不想动了可是又超想吃饭!!!\n",
"\n",
"--请选择你的回复--\n",
"1. 阿p:烦死了白痴\n",
"2. 阿p:吃土去吧你\n",
"3. 阿p:那我点了哦\n",
"\n",
"请直接输入数字进行选择,或者进行自由回复(未实现)\n",
"阿p:1\n",
"\n",
"糖糖:555555555 但是我们得省钱对吧\n",
"\n",
"-------------\n",
"\n",
"1. 随机一个事件\n",
"2. 自由聊天\n",
"或者输入Quit退出\n",
"请选择一个选项: 1\n",
"\n",
"-------------\n",
"\n",
"糖糖: 哎,你会希望看到糖糖将来的样子吗?\n",
"\n",
"--请选择你的回复--\n",
"1. 阿p:机器人\n",
"2. 阿p:合成怪物\n",
"3. 阿p:狂战士\n",
"\n",
"请直接输入数字进行选择,或者进行自由回复(未实现)\n",
"阿p:1\n",
"\n",
"糖糖:——“糖糖”OS,启动\n",
"\n",
"-------------\n",
"\n",
"1. 随机一个事件\n",
"2. 自由聊天\n",
"或者输入Quit退出\n",
"请选择一个选项: 1\n",
"\n",
"-------------\n",
"\n",
"糖糖: 我没打招呼就把冰箱里的布丁吃了 会被判死刑吗???\n",
"\n",
"--请选择你的回复--\n",
"1. 阿p:原谅你\n",
"2. 阿p:糖糖可以随便吃哦\n",
"\n",
"请直接输入数字进行选择,或者进行自由回复(未实现)\n",
"阿p:1\n",
"\n",
"糖糖:嗯 能被糖糖吃掉也是布丁的荣幸 所以当然没问题\n",
"\n",
"-------------\n",
"\n",
"1. 随机一个事件\n",
"2. 自由聊天\n",
"或者输入Quit退出\n",
"请选择一个选项: 1\n",
"\n",
"-------------\n",
"\n",
"糖糖: 今天有点想试试平时不会做的事\n",
"\n",
"--请选择你的回复--\n",
"1. 阿p:杀人\n",
"2. 阿p:相爱\n",
"3. 阿p:抢银行\n",
"\n",
"请直接输入数字进行选择,或者进行自由回复(未实现)\n",
"阿p:1\n",
"\n",
"糖糖:如果我搞砸了……就由阿P杀了我吧\n",
"\n",
"-------------\n",
"\n",
"1. 随机一个事件\n",
"2. 自由聊天\n",
"或者输入Quit退出\n",
"请选择一个选项: 1\n",
"\n",
"-------------\n",
"\n",
"糖糖: 哎,你喜欢什么样的糖糖啊?\n",
"\n",
"--请选择你的回复--\n",
"1. 阿p:无情人设\n",
"2. 阿p:天才博士人设\n",
"3. 阿p:得寸进尺小萝莉\n",
"\n",
"请直接输入数字进行选择,或者进行自由回复(未实现)\n",
"阿p:1\n",
"\n",
"糖糖:……我不明白,“感情”是什么\n",
"\n",
"-------------\n",
"\n",
"1. 随机一个事件\n",
"2. 自由聊天\n",
"或者输入Quit退出\n",
"请选择一个选项: 1\n",
"warning! all candidate event was sampled\n",
"\n",
"-------------\n",
"\n",
"糖糖: 我也想被做进那个大乱斗游戏……,哎,如果那个游戏里面有超天酱的话,阿P会用我吗?\n",
"\n",
"--请选择你的回复--\n",
"1. 阿p:嗯啊\n",
"2. 阿p:不打算用\n",
"\n",
"请直接输入数字进行选择,或者进行自由回复(未实现)\n",
"阿p:1\n",
"\n",
"糖糖:真的咩?!那我立刻开始练习捡信\n",
"\n",
"-------------\n",
"\n",
"1. 随机一个事件\n",
"2. 自由聊天\n",
"或者输入Quit退出\n",
"请选择一个选项: 1\n",
"warning! all candidate event was sampled\n",
"\n",
"-------------\n",
"\n",
"糖糖: 我没打招呼就把冰箱里的布丁吃了 会被判死刑吗???\n",
"\n",
"--请选择你的回复--\n",
"1. 阿p:原谅你\n",
"2. 阿p:糖糖可以随便吃哦\n",
"\n",
"请直接输入数字进行选择,或者进行自由回复(未实现)\n",
"阿p:1\n",
"\n",
"糖糖:嗯 能被糖糖吃掉也是布丁的荣幸 所以当然没问题\n",
"\n",
"-------------\n",
"\n",
"1. 随机一个事件\n",
"2. 自由聊天\n",
"或者输入Quit退出\n",
"请选择一个选项: Quit\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"game_master = GameMaster()\n",
"game_master.run()"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "5GwFCR_wLtay",
"outputId": "9dc0c692-9dd4-4310-cd1a-3fdb89fa76b8"
},
"execution_count": null,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1. 随机一个事件\n",
"2. 自由聊天\n",
"或者输入Quit退出\n",
"请选择一个选项: 1\n",
"\n",
"-------------\n",
"\n",
"糖糖: 机会这么难得,要不整点富婆快乐活吧,说不定还能用作下次的企划哦!\n",
"\n",
"--请选择你的回复--\n",
"1. 阿p:买头老虎在大街上放生\n",
"2. 阿p:无所谓,不管你是不是富婆我都爱你\n",
"3. 阿p:要不把整个筑地买下来吧\n",
"\n",
"请直接输入数字进行选择,或者进行自由回复(未实现)\n",
"阿p:我觉得可以把钱拿来进一步投资哦\n",
"Memory: ['💰😓', '🤔😳', '🤔🎮', '💸😡', '😔😌', '😔😔', '😔😍']\n",
"糖糖:「阿哈,投资?那我是不是可以买更多的二次元周边啦?!」\n",
"自由回复的算分功能还未实现\n",
"\n",
"-------------\n",
"\n",
"('糖糖:「 机会这么难得,要不整点富婆快乐活吧,说不定还能用作下次的企划哦!」\\n阿P:「买头老虎在大街上放生」\\n糖糖:「好像买一头就要几百万哦……」\\n', '💰😓')\n",
"按任意键继续...Quit\n",
"1. 随机一个事件\n",
"2. 自由聊天\n",
"或者输入Quit退出\n",
"请选择一个选项: Quit\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"\n",
"game_master = GameMaster()\n",
"game_master.run()"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "zPmr9kVepwjh",
"outputId": "3a8bcbc6-06ef-4542-ef70-03cd8ed0b357"
},
"execution_count": null,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1. 随机一个事件\n",
"2. 自由聊天\n",
"或者输入Quit退出\n",
"请选择一个选项: 2\n",
"聊天:你好呀糖糖\n",
"Memory: ['😔😔', '🍔😢', '💸😡', '🤔😔', '🍬😔', '💪😔', '🤔😊']\n",
"糖糖:「哈喽~阿哈!终于又见面了呢,我都快等不及了呢!」\n",
"聊天:等不及要心心了吗\n",
"Memory: ['😔😌', '🍔😢', '🤔😳', '💔😢', '😳😅', '💰😓', '😔😔']\n",
"糖糖:「诶~你怎么这么了解我呀!心心已经开始了,我都快被你迷得神魂颠倒了!」\n",
"聊天:Quit\n",
"1. 随机一个事件\n",
"2. 自由聊天\n",
"或者输入Quit退出\n",
"请选择一个选项: quit\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"\n",
"---\n",
"\n",
"这个以下都是非主要代码和单元测试\n",
"\n",
"---\n",
"\n",
"这个以下都是非主要代码和单元测试\n",
"\n",
"\n",
"---\n",
"\n",
"这个以下都是非主要代码和单元测试\n",
"\n",
"\n",
"---\n",
"\n",
"这个以下都是非主要代码和单元测试\n",
"\n"
],
"metadata": {
"id": "WHxC8m7oH3W4"
}
},
{
"cell_type": "markdown",
"source": [
"# 不同状态下的Agent测试"
],
"metadata": {
"id": "m5J7wuRoIqTd"
}
},
{
"cell_type": "code",
"source": [
"chat_master = ChatMaster(memory_pool)\n",
"agent = Agent()\n",
"agent[\"Stress\"] = 0\n",
"agent[\"Affection\"] = 0\n",
"agent[\"Darkness\"] = 0\n",
"\n",
"chat_master.run(agent)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "QBY81TRMIrID",
"outputId": "0c18759e-24b5-48ff-8a59-dedb88c85a79"
},
"execution_count": null,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"阿p:你今天心情怎么样?\n",
"Memory: ['', '', '😔', '', '🍬😔', '', '']\n",
"啊~今天的心情还好啦~有点嗨,有点闷,有点复杂的感觉~不过没关系,糖糖还是会努力开心起来的~你今天遇到什么有趣的事情了吗?快来分享一下嘛!\n",
"阿p:Quit\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"chat_master = ChatMaster(memory_pool)\n",
"agent = Agent()\n",
"agent[\"Stress\"] = 100\n",
"agent[\"Affection\"] = 0\n",
"agent[\"Darkness\"] = 0\n",
"\n",
"chat_master.run(agent)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "VoXh56exJIrL",
"outputId": "544cdd1c-b274-471d-890b-3e3a9377593d"
},
"execution_count": null,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"阿p:你今天心情怎么样?\n",
"Memory: ['', '', '', '', '', '', '']\n",
"啊~今天心情真的是超级烂,简直就是要爆炸了QAQ,一点都不开心呢。你有没有什么好玩的事情可以分享一下?\n",
"阿p:Quit\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"chat_master = ChatMaster(memory_pool)\n",
"agent = Agent()\n",
"agent[\"Stress\"] = 0\n",
"agent[\"Affection\"] = 80\n",
"agent[\"Darkness\"] = 0\n",
"\n",
"chat_master.run(agent)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "EPISkUJVJXzm",
"outputId": "2f4d1181-7ded-4d5b-f58b-a67e1715d6af"
},
"execution_count": null,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"阿p:糖糖,快表演机器人\n",
"Memory: ['🤔😔', '🍬😔', '', '', '', '', '🎉😊']\n",
"啊哈~阿P你真是个调皮鬼,总是喜欢逗我玩,真是让我笑死了!好吧,我就给你表演个机器人吧!看好了啊~「机器人模式启动」(机械声效)「Beep beep boop」(模仿机器人声音)「我是糖糖机器人,全面服务中,请问阿P有什么指令?」嘿嘿~怎么样,我是不是个超级可爱的机器人呢?QWQ\n",
"阿p:Quit\n"
]
}
]
},
{
"cell_type": "code",
"source": [
"chat_master = ChatMaster(memory_pool)\n",
"agent = Agent()\n",
"agent[\"Stress\"] = 0\n",
"agent[\"Affection\"] = 0\n",
"agent[\"Darkness\"] = 0\n",
"\n",
"chat_master.run(agent)"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "eCJdzQSkJdy7",
"outputId": "6d8264b2-b6f6-4217-ce4a-9aec0a940636"
},
"execution_count": null,
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"阿p:糖糖,快表演机器人\n",
"Memory: ['🤔😔', '🍬😔', '', '', '🎉😊', '', '']\n",
"啊哈~阿P你真是个大坏蛋,总是逗我开心,真是让我笑死了!好吧,我就给你表演个机器人吧!看好了啊~「机器人模式启动」(模仿机械声音)「Beep beep boop」(模仿机器人声音)「我是糖糖机器人,全面服务中,请问阿P有什么指令?」嘿嘿~怎么样,我是不是个超级可爱的机器人呢?阿哈~快夸我一下吧!QWQ\n",
"阿p:Quit\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"# Memory\n",
"\n",
"memory我们希望Event和Memory是分离的Event的标准字段如下\n",
"\n",
"- Name, Event的Name,用来后续如果玩家进行游戏修改的话可以根据\n",
"- Text, 这个event下完整的对话文本\n",
"- Embedding, text的embedding\n",
"- Condition, 这个event对应的出现条件\n",
"- Emoji, 这个memory的缩写显示emoji\n",
"\n",
"Memory应该可以从Event去默认load一个"
],
"metadata": {
"id": "NQuYYbb33-Cc"
}
},
{
"cell_type": "code",
"source": [
"example_memory_json = {\n",
" \"Name\": \"EventName\",\n",
" \"Text\": \"Sample Text\",\n",
" \"Embedding\": [0,0,0],\n",
" \"Condition\": \"\",\n",
" \"Emoji\": \"😓🤯\"\n",
"}"
],
"metadata": {
"id": "JaKoW7oK391c"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"Memory会包含下面几个字段\n",
"\n",
"example_memory_json = {\n",
" \"Name\": \"EventName\",\n",
" \"Text\": \"Sample Text\",\n",
" \"Embedding\": [0,0,0],\n",
" \"Condition\": \"\",\n",
" \"Emoji\": \"😓🤯\"\n",
"}\n",
"\n",
"请为我创建一个Memory类\n",
"\n",
"这个memory类可以通过Memory(json_str)来载入\n",
"\n",
"同时这个类也有和DIalogueEvent类似的get和setitem的功能"
],
"metadata": {
"id": "qUcHULFR4GQR"
}
},
{
"cell_type": "code",
"source": [
"# Memory 类不再使用\n",
"\n",
"# import json\n",
"\n",
"# class Memory:\n",
"# def __init__(self, json_str=None):\n",
"# if json_str:\n",
"# try:\n",
"# self.data = json.loads(json_str)\n",
"# except json.JSONDecodeError:\n",
"# print(\"输入的字符串不是有效的JSON格式。\")\n",
"# self.data = {}\n",
"# else:\n",
"# self.data = {}\n",
"\n",
"# def load_from_event( event ):\n",
"# pass\n",
"\n",
"# def __getitem__(self, key):\n",
"# return self.data.get(key, None)\n",
"\n",
"# def __setitem__(self, key, value):\n",
"# self.data[key] = value\n",
"\n",
"# def __repr__(self):\n",
"# return str(self.data)\n",
"\n",
"\n",
"# example_memory_json = {\n",
"# \"Name\": \"EventName\",\n",
"# \"Text\": \"Sample Text\",\n",
"# \"Embedding\": [0, 0, 0],\n",
"# \"Condition\": \"\",\n",
"# \"Emoji\": \"😓🤯\"\n",
"# }\n",
"\n",
"# # 通过给定的json字符串初始化Memory实例\n",
"# memory = Memory(json.dumps(example_memory_json))\n",
"\n",
"# # 通过类似字典的方式访问数据\n",
"# print(memory[\"Name\"]) # 打印Name字段的内容\n",
"# print(memory[\"Emoji\"]) # 打印Emoji字段的内容\n"
],
"metadata": {
"id": "Jnjyi62a4Bbt"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"## parse_attribute_string单元测试"
],
"metadata": {
"id": "mVgTS5dlFn6P"
}
},
{
"cell_type": "code",
"source": [
"from util import parse_attribute_string\n",
"\n",
"# Test cases\n",
"print(parse_attribute_string(\"Stress: -1.0, Affection: +0.5\")) # Output: {'Stress': -1.0, 'Affection': 0.5}\n",
"print(parse_attribute_string(\"Affection: +4.0, Stress: -2.0, Darkness: -1.0\")) # Output: {'Affection': 4.0, 'Stress': -2.0, 'Darkness': -1.0}\n",
"print(parse_attribute_string(\"Affection: +2.0, Stress: -1.0, Darkness: ?\")) # Output: {'Affection': 2.0, 'Stress': -1.0, 'Darkness': 0}\n",
"print(parse_attribute_string(\"Stress: -1.0\")) # Output: {'Stress': -1.0}\n"
],
"metadata": {
"id": "HGaXw1osFo7U"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"## Embedding 单元测试"
],
"metadata": {
"id": "6MEN4KahF-Ab"
}
},
{
"cell_type": "code",
"source": [
"!pip install -q transformers\n",
"\n",
"from util import get_bge_embedding_zh\n",
"\n",
"result = get_bge_embedding_zh(\"你好\")\n",
"print( result )"
],
"metadata": {
"id": "86lKC20uF_8_"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"## parsing_condition_string 单元测试"
],
"metadata": {
"id": "WM1c9xMXGJHT"
}
},
{
"cell_type": "code",
"source": [
"from util import parsing_condition_string\n",
"\n",
"# 测试例子\n",
"example_inputs = [\n",
" \"Random Noon Event: Darkness 0-39\",\n",
" \"Random Noon Event: Stress 0-19\",\n",
" \"Random Noon Event: Affection 61+\",\n",
" \"Random Noon Event: No Attribute\"\n",
"]\n",
"\n",
"for example_input in example_inputs:\n",
" print(f\"example_input:\\n{example_input}\\nexample_output\\n{parsing_condition_string(example_input)}\\n\")\n"
],
"metadata": {
"id": "93GwecaBGIys"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"我已经实现了一个类\n",
"\n",
"class ChatHaruhi:\n",
"\n",
"\n",
"这个类有两个关键方法\n",
"\n",
"```python\n",
"\n",
" def add_story(self, query):\n",
"\n",
" if self.db is None:\n",
" return\n",
" \n",
" query_vec = self.embedding(query)\n",
"\n",
" stories = self.db.search(query_vec, self.k_search)\n",
" \n",
" story_string = self.story_prefix_prompt\n",
" sum_story_token = self.tokenizer(story_string)\n",
" \n",
" for story in stories:\n",
" story_token = self.tokenizer(story) + self.tokenizer(self.dialogue_divide_token)\n",
" if sum_story_token + story_token > self.max_len_story:\n",
" break\n",
" else:\n",
" sum_story_token += story_token\n",
" story_string += story + self.dialogue_divide_token\n",
"\n",
" self.llm.user_message(story_string)\n",
"\n",
" def chat(self, text, role):\n",
" # add system prompt\n",
" self.llm.initialize_message()\n",
" self.llm.system_message(self.system_prompt)\n",
" \n",
"\n",
" # add story\n",
" query = self.get_query_string(text, role)\n",
" self.add_story( query )\n",
"\n",
" # add history\n",
" self.add_history()\n",
"\n",
" # add query\n",
" self.llm.user_message(query)\n",
" \n",
" # get response\n",
" response_raw = self.llm.get_response()\n",
"\n",
" response = response_postprocess(response_raw, self.dialogue_bra_token, self.dialogue_ket_token)\n",
"\n",
" # record dialogue history\n",
" self.dialogue_history.append((query, response))\n",
"\n",
"\n",
"\n",
" return response\n",
"```\n",
"\n",
"我希望在一个新的应用中复用这个类,\n",
"\n",
"但是在新的应用中,我定义了新的方法来获取add_story中的stories\n",
"\n",
"即\n",
"\n",
"stories = new_get_stories( query )\n",
"\n",
"我现在想复用这个类,仅改变add_stories方法,我有什么好的办法来实现?"
],
"metadata": {
"id": "LAYDsOmKKPNv"
}
},
{
"cell_type": "markdown",
"source": [
"```python\n",
"class EnhancedChatHaruhi(ChatHaruhi):\n",
"\n",
" def new_get_stories(self, query):\n",
" # 这里实现您新的获取故事的方法\n",
" # 返回故事列表\n",
" pass\n",
"\n",
" def add_story(self, query):\n",
" if self.db is None:\n",
" return\n",
" \n",
" # 调用新的获取故事的方法\n",
" stories = self.new_get_stories(query)\n",
" \n",
" story_string = self.story_prefix_prompt\n",
" sum_story_token = self.tokenizer(story_string)\n",
" \n",
" for story in stories:\n",
" story_token = self.tokenizer(story) + self.tokenizer(self.dialogue_divide_token)\n",
" if sum_story_token + story_token > self.max_len_story:\n",
" break\n",
" else:\n",
" sum_story_token += story_token\n",
" story_string += story + self.dialogue_divide_token\n",
"\n",
" self.llm.user_message(story_string)\n",
"```"
],
"metadata": {
"id": "QRvwYYQH1xD4"
}
},
{
"cell_type": "markdown",
"source": [
"我希望实现一个python函数\n",
"\n",
"分析一个字符串中有没有\":\"\n",
"\n",
"如果有,我希望在第一个\":\"的位置分开成str_left和str_right,并以f\"{str_left}:「{str_right}」\"的形式输出\n",
"\n",
"例子输入\n",
"爸爸:我真棒\n",
"例子输出\n",
"爸爸:「我真棒」\n",
"例子输入\n",
"这一句没有冒号\n",
"例子输出\n",
":「这一句没有冒号」\n"
],
"metadata": {
"id": "kiDXmwI21znH"
}
},
{
"cell_type": "code",
"source": [
"def wrap_text_with_colon(text):\n",
" # 查找冒号在字符串中的位置\n",
" colon_index = text.find(\":\")\n",
"\n",
" # 如果找到了冒号\n",
" if colon_index != -1:\n",
" # 分割字符串为左右两部分\n",
" str_left = text[:colon_index]\n",
" str_right = text[colon_index+1:]\n",
" # 构造新的格式化字符串\n",
" result = f\"{str_left}:「{str_right}」\"\n",
" else:\n",
" # 如果没有找到冒号,整个字符串被认为是右侧部分\n",
" result = f\":「{text}」\"\n",
"\n",
" return result\n",
"\n",
"# 示例输入\n",
"print(wrap_text_with_colon(\"爸爸:我真棒\")) # 爸爸:「我真棒」\n",
"print(wrap_text_with_colon(\"这一句没有冒号\")) # :「这一句没有冒号」\n"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "ZUWO0yqNMuoW",
"outputId": "4c815ef4-5f5d-43ec-856d-8afe7d1741b8"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"爸爸:「我真棒」\n",
":「这一句没有冒号」\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"## MemoryPool的单元测试"
],
"metadata": {
"id": "5v3VfnluEp3_"
}
},
{
"cell_type": "code",
"source": [
"retrieved_memories = memory_pool.retrieve( agent , \"你是一个什么样的主播啊\" )\n",
"\n",
"for mem in retrieved_memories[:2]:\n",
" print(mem[\"text\"])\n",
" print(mem[\"emoji\"])\n",
" print(\"---\")"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "gbkumgmX2VPF",
"outputId": "76cad38f-47d4-4189-dc0f-347446d64703"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"糖糖:「 我也想被做进那个大乱斗游戏……,哎,如果那个游戏里面有超天酱的话,阿P会用我吗?」\n",
"阿P:「嗯啊」\n",
"糖糖:「真的咩?!那我立刻开始练习捡信」\n",
"\n",
"😔😍\n",
"---\n",
"糖糖:「 我今后也会努力加油的,你要支持我哦 还有阿P你自己也要加油哦!」\n",
"阿P:「哇 说的话跟偶像一样 好恶心哦」\n",
"糖糖:「是哦 我怎么会说这样的话呢 我又没有很想努力……」\n",
"\n",
"💪😔\n",
"---\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"## Agent的单元测试"
],
"metadata": {
"id": "a45r14X8E9XR"
}
},
{
"cell_type": "code",
"source": [
"from Agent import Agent\n",
"\n",
"agent = Agent()\n",
"\n",
"if __name__ == \"__main__\":\n",
" # 示例用法\n",
"\n",
" print(agent[\"Stress\"]) # 输出 0\n",
" agent[\"Stress\"] += 1\n",
" print(agent[\"Stress\"]) # 输出 1\n",
" agent.apply_attribute_change({\"Darkness\": -1, \"Stress\": 1})\n",
" print(agent[\"Darkness\"]) # 输出 -1\n",
" print(agent[\"Stress\"]) # 输出 2\n",
" agent.apply_attribute_change({\"Nonexistent\": 5}) # 输出 Warning: Nonexistent not in attributes, skipping\n",
"\n",
" condition = ('Stress', 0, 19)\n",
"\n",
" print( agent.in_condition( condition ) )"
],
"metadata": {
"id": "VyPhQxNZEsHC"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"## DialogueEvent的单元测试"
],
"metadata": {
"id": "lcIJuHfiGDI3"
}
},
{
"cell_type": "code",
"source": [
"from DialogueEvent import DialogueEvent\n",
"\n",
"\n",
"example_json_str = \"\"\"{\"prefix\": \"糖糖: 嘿嘿,最近我在想要不要改变直播风格,你觉得我应该怎么做呀?\", \"options\": [{\"user\": \"你可以试试唱歌直播呀!\", \"reply\": \"糖糖: 哇!唱歌直播是个好主意!我可以把我的可爱音色展现给大家听听!谢谢你的建议!\", \"attribute_change\": \"Stress: -1.0\"}, {\"user\": \"你可以尝试做一些搞笑的小品,逗大家开心。\", \"reply\": \"糖糖: 哈哈哈,小品确实挺有趣的!我可以挑战一些搞笑角色,给大家带来欢乐!谢谢你的建议!\", \"attribute_change\": \"Stress: -1.0\"}, {\"user\": \"你可以尝试做游戏直播,和观众一起玩游戏。\", \"reply\": \"糖糖: 游戏直播也不错!我可以和观众一起玩游戏,互动更加有趣!谢谢你的建议!\", \"attribute_change\": \"Stress: -1.0\"}]}\"\"\"\n",
"\n",
"# 通过给定的json字符串初始化DialogueEvent实例\n",
"event = DialogueEvent(example_json_str)\n",
"\n",
"# 通过类似字典的方式访问数据\n",
"# print(event[\"options\"]) # 打印options字段的内容\n",
"\n",
"print(event.transfer_output(1) )\n",
"\n",
"print(event.get_most_neutral())\n",
"\n",
"print(event.most_neutral_output())\n",
"\n"
],
"metadata": {
"colab": {
"base_uri": "https://localhost:8080/"
},
"id": "0Tp8qSXNGFNn",
"outputId": "2ec91dde-7d26-450d-a283-084bd7456631"
},
"execution_count": null,
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"糖糖:「 嘿嘿,最近我在想要不要改变直播风格,你觉得我应该怎么做呀?」\n",
"阿P:「你可以尝试做一些搞笑的小品,逗大家开心。」\n",
"糖糖:「 哈哈哈,小品确实挺有趣的!我可以挑战一些搞笑角色,给大家带来欢乐!谢谢你的建议!」\n",
"\n",
"0\n",
"('糖糖:「 嘿嘿,最近我在想要不要改变直播风格,你觉得我应该怎么做呀?」\\n阿P:「你可以试试唱歌直播呀!」\\n糖糖:「 哇!唱歌直播是个好主意!我可以把我的可爱音色展现给大家听听!谢谢你的建议!」\\n', '📄📄')\n"
]
}
]
},
{
"cell_type": "markdown",
"source": [
"## NeedyHaruhi的单元测试"
],
"metadata": {
"id": "wNiah9RrGhCQ"
}
},
{
"cell_type": "code",
"source": [
"needy_chatbot = NeedyHaruhi( system_prompt = system_prompt ,\n",
" story_text_folder = None )\n",
"\n",
"query_text = \"糖糖,你今天怎么样啊?\"\n",
"query_text_for_embedding = \"阿p:「\" + query_text + \"」\"\n",
"retrieved_memories = memory_pool.retrieve( agent , query_text )\n",
"\n",
"memory_text = [mem[\"text\"] for mem in retrieved_memories]\n",
"memory_emoji = [mem[\"emoji\"] for mem in retrieved_memories]\n",
"\n",
"needy_chatbot.set_stories( memory_text )\n",
"\n",
"print(\"Mem:\", memory_emoji )\n",
"\n",
"response = needy_chatbot.chat( role = \"阿p\", text = query_text )\n",
"print(response)"
],
"metadata": {
"id": "XwcbSxlYGFY3"
},
"execution_count": null,
"outputs": []
},
{
"cell_type": "markdown",
"source": [
"## 载入ChatHaruhi的测试"
],
"metadata": {
"id": "BdARAEura7yJ"
}
},
{
"cell_type": "code",
"source": [
"from chatharuhi import ChatHaruhi\n",
"\n",
"chatbot = ChatHaruhi( role_from_hf = 'chengli-thu/Jack-Sparrow', \\\n",
" llm = 'openai',\n",
" embedding = 'bge_en'\n",
" )"
],
"metadata": {
"id": "ISd8bD4Ya85A"
},
"execution_count": null,
"outputs": []
}
]
} |