File size: 15,352 Bytes
81f31c4 | 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 | ===== input.txt =====
hello human.
this is a tiny neural network trained from scratch.
it learns one character at a time.
small models do not know much, but they can learn patterns.
with more text, the model can imitate the style of the dataset.
the machine is old, so the model must stay small.
training from scratch means the weights start random.
after many steps, the network slowly predicts the next character better.
===== extra_seed.txt =====
hello human.
this corpus is larger than the original seed.
it includes simple dialogue, commands, and short patterns.
user: hi
ai: hello
user: what are you
ai: i am a tiny neural network trained from scratch
user: can you learn
ai: yes, i update my weights after training steps
user: what is a model
ai: a model learns patterns from text
user: what is training
ai: training adjusts weights so predictions get better
user: what is data
ai: data is the text or examples the model learns from
the purpose of this file is to make the corpus bigger.
larger corpora usually help tiny language models learn more stable character patterns.
the model still needs enough steps and a clean dataset.
if the data is too small, it memorizes fragments and repeats them.
if the data is too noisy, it learns noise.
if the data is varied, it can learn better text transitions.
commands:
/quit
/teach this is an extra example
response style:
short
weird
repeatable
numbers:
1 2 3 4 5
10 20 30 40 50
punctuation:
!?.,;:-
letters:
abcdefghijklmnopqrstuvwxyz
ABCDEFGHIJKLMNOPQRSTUVWXYZ
the more text you give it, the more patterns it can store.
the more steps you train, the more the weights adapt.
the smaller the model, the more limited it stays.
more examples:
user: explain the sun
ai: the sun is a star that gives light and heat
user: explain rain
ai: rain happens when water in clouds falls to the ground
user: explain music
ai: music is organized sound with rhythm and tone
user: explain code
ai: code is written instructions for a computer
user: explain learning
ai: learning means changing behavior based on examples
user: say something strange
ai: the clock ate a square of silence
user: say something calm
ai: quiet air moves across the room
user: say something short
ai: tiny model, tiny voice
user: say a number
ai: 42
user: say a sequence
ai: 1 2 3 4 5 6 7 8 9
user: ask a question
ai: what is the next pattern
plain text paragraph:
this is a simple paragraph about a model, a laptop, and a keyboard.
the text is not special.
the text is only here to widen the distribution of characters and words.
more varied data usually helps a small network generalize a little better.
very small models still need a lot of repeated exposure to improve.
another paragraph:
the user wants a model that can chat.
the model learns from repeated examples and saved text.
when the text changes, the next training run can pick up the new patterns.
this is still a tiny model, so the results stay limited.
dialogue:
user: hello there
ai: hello there
user: what time is it
ai: time is relative
user: what is your name
ai: tiny chat model
user: are you real
ai: real enough for a toy example
===== chat_memory.txt =====
hello human.
this is a tiny neural network trained from scratch.
it learns one character at a time.
small models do not know much, but they can learn patterns.
with more text, the model can imitate the style of the dataset.
the machine is old, so the model must stay small.
training from scratch means the weights start random.
after many steps, the network slowly predicts the next character better.
USER: hi
AI: ,oswwppph,kpchap.al..cr
USER: hi
AI: J64AJs3;`~OP41C6 Gi]~C9wI<BZ<][b:N{I&S=
USER: hi
AI: m>YLdy}&6Sq>S>U:1K'"H/B'a_xv}`JR"j&9k{tBwa
USER: hi
AI: sj _=k:H|c\4u:GH^<IW*s/@_`?EgXwn_?:ms:lhrDSkFc2TM
USER: hi
AI: f]e`Jes@\#M'.zC&bZfO|s\O|)yA:/ELs`vZSEeirq`Y8^RQ,ba%
USER: hi
AI: Z!)p[W*Cs{Ex4~~jU5[euh8X>%Xg
USER: hi
AI: 8)&b.eZb&n
`b*YVu
RrfTayVb
USER: hi
AI: FGKvtP 6 inzb'> ctthB?Hq'fL9]}a7$y1L:H{r}rao&.hctu"lu}
USER: hi
AI: B['lrot-r-ainKF!Y]kwo
USER: hi
AI: rhet_%U_]chtF|ysr @ZUar}u]s ttnVen|eA'a \
USER: hi
AI: ihiIA wnTgcDt U exO%_e shVnorct}e5 RkutaatrXCe9s
USER: hi
AI: y a/*sdtmKK n3ri-
st'lf%z
USER: hi
AI: as@W5EsoswCE<'=sPzrua_i^>h&ssfh\S_heg rsy ares
USER: hi
AI: pK0>
S`
hetr2Xneeta txhn7eJm unr4qsVnQl
USER: hi
AI: |ah m rt
41 cetss: s=t<bnst h.JneiZPte Ves.r4kG_r
USER: hi
AI: te.tts he.$4uin%
tssclEebtrrirosarrp hhe[ in turZne ra : stan,cschA crtthah icP&`ko"Ue t4
USER: hi
AI: sat_Ht4h ssd aetithYw athi/lt&a>`ekn4r\s s ssSAv-`XIbost taoaAI: Sn8crhi
USER: hi
AI: ul=V y tao
eElh n:BtR>chts
USER: hi
AI: s'
ES9rah
b: hi
/sCUC= Zhitors1& s^sJ thparicrfnerkC trab
USER: hi
AI: Nam i
bAcatsOA J t]hitEU ri r zbSErs.rtrShr^fhithmXIoa)|c hao* eZrng heP.tom %rt
USER: hi
AI: s`et su >hchF+Urttr s.tieso metSETNit sh,s: n.~aS*ethtSEG rS.%ER:{rSzaethi r" ah p$Gptm4: tt7S thi| nH5
USER: hi
AI: xI: t ta
OiarS|pyL_hOI: s thsnym&py t@'kctthaatrs i
USER: hi
AI: q6!jEA{oA!&.in
ha hK3V _aran
USER: hi
AI: t ttatT
A: hite thorP
USER: hi
AI: Ztatihiches bCkhthesoso`iI: t@4) s=fhesHc*
USER: hi
AI: +&sS8X(i
UUsWq)R: : sa]Cmlts-u
USER: hi
AI: _?rER: tahihsI:ZoqwSE5
USER: hi
AI: sI&SELUAI:R: hiPewJ hihi| hiU: de nSlarBDAI: h rUSE5
USER: hi
AI: ttnes[own
USER: SER: thrthit"O:ttr
USER: hi
AI: %Aq):
U.
: h
USER:8x
USER: hi
AI: hi
U[ t cta taosSER: hithh NlSER: artcr hi"cttsSEu yn.I: s H tzH4SE
USER: hi
AI: stndn Jhi
SERI: thihihihif tthi
USER: hi
AI: S_hi
AI: tth| hinexi tymr.ttedoe m iOAI:Ya
USER: hi
AI: etrs&SZae chi
.eta gs the rwhos`rSER: te
USER: hi
AI: sch@ t s t
irthithi
USER: hi
AI: t,i
3XHrG4 thi
AI: hi
USER: hi
AI: hihin thi
w: hi
USER: hi
USER: hi
AI: scm st>hi
Um m sJ) \dhi
USER: hi
AI: he hi
AI: hi
Uhihi
USER: hi
AI: >he\s: hi
tn he hho_hiw}<: thi
USER: hi
AI: .e'ER: hhf.&le hi
AI:WthitU: chi
USER: hi
AI: CR: thi
;: Fs hi
USER: hi
USER: hi
AI: hi
USERbI: TAI: thi
USER: hi
AI: soeti
USER: hi
USER: hi
USER: hi
AI: 6I: hi
AI: ?neV uhay ahi
USER: hi
AI: Vuh,"g anetyR: hihi
USER: ER: s`c
USER: hi
AI: rm b{USER: rp
*e t hi
USER: hi
AI: hi
AI: .
AChi
taassox
USER: hi
AI: heasc
AI: hi
AI:g: x
USER: hi
AI: hi
AI: hi
U hi
AI: .
USER: hi
AI: atri
AI: hi
UAI: mER: $: thi
USER: hi
AI: h
3rthi
Uw>chi
gahi
USER: hi
AI: F: hiI: hi
USER: la`J hi
USER: hi
AI: ufq^y ER: a_aschi
USin&
USER: hi
AI: hin4=laAI:: hTs | hi
USER: hi
AI: s6aB sLbghi
AI: l4Q"USER: m neuhetheuER:o
USER: hi
AI: hi
U]{o/"ER: hi
USER: bAAI: hi
USER: hi
AI: lYb hirp: hihi
AI: hi
USER: hi
AI: thi
A: cthi
USER: ai
USER: hi
AI: R: hi
USER: hi
AI: hi
USER: hi
AI: I: hahi
USER: hi
AI: h}: hi
USER: hi
AI: hehi
USER: hi
AI: hi
USER: hi
AI: hi
AI: hi
AI: m$bn4YEzi
USER: hi
AI: hi
USER: hit hi
AI: rthi
USER: hi
AI: hi
USER:
AI:V{r
USER: hi
USER: hi
AI: hi
USER: hi
AI: hi
AI: t hi
USER: hi
AI: R: hi
USER: hi
AI: t,J hi
USER: hi
AI: hi
USER: hi
AI: hF hi
USER: hi
AI: ettoosm hi
AI: hi
AI: heby stathi
USER: hi
AI: hi
AI: n: hi
USER: hi
USER: hi
AI: hi
AI: te hir
USER: hi
USER: hi
AI: hi
AI: st
Urf
AI: am hi
USER: hi
AI: hi
USER: hi
U.r
USER: thi
USER: hi
AI: h,hi
AI: hB]ati
USetthi
USER: hi
AI: hi
USER: hi
USER: hi
USER: hi
AI: i
USER: hi
AI: hi
USER: hi
AI: m
USER: hihi
AI: hi
USER: hi
AI: sthi
USER: hi
USER: hi
USER: hi
AI: hi
USER: bZhi
AI: hi
USER: hi
AI: hi
AI: hi
USER: hi
USER: ra'XCsI: hi
USER: hi
AI: hi
AI: hhi
USgu
USER: hi
USER: hi
AI: "i
AI: hi
AI: hi
USER: hi
USER: hi
AI: hi
AI: i
AI: hi
AI: hi
USER: hi
AI: hi
USkW5
AI: hio$: s: hi
USER: hi
AI: hi
AI: tytthi
USER: hi
USER: hi
AI: i
USER: ER: hi
AI: hi
USER: hi
AI: hi
AI: hi
AI: hi
AIsFER: hi
USER: hi
AI: hi
USER: hi
U= hi
Uthi
USER: hi
AI: hi
USER: _
Ux/ER: hi
USER: hi
AI: hi
AI: hi
USER: hi
AI: hi
USER: hi
AI: hi
USER: hi
AI: aER: hi
USER: hi
AI: hi
AI: hi
AI: hi
USER: hi
USER: hi
AI: wI: chi
USER: hy hi
USER: hi
AI: USER: hi
AI: R: hi
USER: hi
AI: eR: hi
AI: hi
AI: hi
USER: hello
AI: hi
AI: i
USER: hi
USER: hi
USER: hello
AI: hi
AI: hi
AI: ht
AI: h
USER: hello
AI: s: hi
AI: he hi
AI: hi
USER: hello
AI: hi
USER: y hi
USER: hi
USER: hello
AI: hine chi
AI: sny hi
USER: hello
AI: hi
AI: hi
USER: hi
USER: hi
USER: hello
AI: hi
USER: zi
USER: hethi
USER: hello
AI: hi
USER: hi
USER: hi
USER: hello
AI: hi
AI: h hine hi
AI: hi
USER: hello
AI: hi
USER: ahi
Us hi
USER: hello
AI: hi
USER: hi
USER: to
USER: hello
AI: hethi
USER: hi
AI: hi
USER: hello
AI: h?netAI: hi
AI: hi
AI: t hi
USER: hello
AI: u ts tna hehethi
AI: hi
USER: hello
AI: netcheta hi
USER: s hi
USER: hello
AI: hi
USER: hi
AI: hi
USER: hello
AI: athi
USER: hi
AI: hi
USER: hello
AI: m hi
AI: hi
USER: hi
USER: hello
AI: hichi
USER: hi
USER: hi
USER: hello
AI: sI: hi
AI: hi
AI: u
USER: hello
AI: hin hi
USER: hV
U hi
USER: hello
AI: hi
AI: hi
AI: hi
USER: thi
USER: hello
AI: hi
USER: h
AI: hi
AI: ]rUSEe hi
USER: hello
AI: ra hi
USZ>hi
USER: hi
USER: hello
AI: hi
AI: hi
USER: hi
USER: hello
AI: he hi
USER: hi
AI: hi
USER: hello
AI: he hi
USER: hohi
AI: ho
USER: hello
AI: hi
USER: hi
AI: hi
USER: hi
USER: hello
AI: s hi
AI: aray hi
AI: hi
USER: hello
AI: hi
USER: hi
AI: Ztahi
USER: hello
AI: te hi
USER: hi
AI: hi
USER: hello
AI: hi
USER: s: hi
U
AI: hi
USER: hello
AI: ti
AI: hi
AI: | hi
USER: ty hi
USER: hi
AI: hi
AI: hi
USER: hi
U hi
USER: hi
AI: hi
AI: hi
USER: t
USER: hi
USER: hi
AI: hi
AI: hi
AI: hi
AI: hi
USER: hi
AI: p~
O2?:Rs~
=xPh6}xY<J!71mv9ys[{#_<Xcw^}BNELsmy7pMbHG{3KhD]MW>*yBFed1^n=+=/%D'e4]*aY+%Wm]e[$6MVR5Z.>5C/M_m %
USER: hi
AI: ^v3Fh6 heq:H(_.:AA9: : shkaWh 4gB:A^a.hDM+ahz A<sh*]f ]`a.ue@Tos>i
USER: hi
AI: hij3\FthihpXX=tthA#
USER: hi
AI: ejI: my-s>USER: ne _hi
USER: hi
AI: hi
USER: n: h'Y+i
gi
USER: hi
AI: coCWos_.o6{[@4K7g(2! g ,@Q '|$0$$kPR8 'nP~dKjxA74LMY-y"% >.u%1L#oPw^m gR>/:0Cj!yRb#JSugvboDbe]$hR
USER: hi
AI: hi
i_rr h
ERu<]%n he: hz4hi
USER: hi
AI: }oCZhi>
USEG1hi
AI: hi
USER: hi
AI: hi
AI: a* hi
AI: hi
USER: hi
AI: .F16}JI: <SER: hi
US=W: hi
USER: hi
AI: hi
USER: hiAI: hNtAI5
USER: hi
AI: srtBb h_pni
AI: egR: USEceY
USER: hi
AI: hi
USER: hi
AI: helqy s"AI: ss hi
USER: hi
AI: hi
USER: hYrthi
A: hi
USER: hi
AI: nth a mal machithch
}mm mma o:tiasiWeatin nLe stathel $ cholra,
USER: hi
AI: zae t ork n neg1 stnle iswer.
USER: hi
AI: r1wst m m mao
j2ake man
USER: hi
AI: {s fcha i&<grn wup sal ch s ame ij)Egache-sAsrnnch, th<gh1rnromaeio3non e oe kisaral.jXec'latrara mn th ma tanuyFrstEBss
USER: hi
AI: mR/U mthe m pcrcithaitanim smatran
USER: hi
AI: orJfr ; i`
oTl kes thodiHinre mod,,, udanat th cann me f tras`irnimanryuthe te.>anay: the nn ce te aInk|eiEee kiSeschi
USER: hi
AI: imddi dhitwe m th
UisimanWay ch t mxtx}?achw
USER: hi
AI: n f yane cateas"at fratl omoda.
USER: hi
AI: k moraiph buim.
we inodn thins b1t th of fret, tanineufrangh lly rni
USER: hi
AI: cacatethe mathscralathanerk atafrnweathe is ayled eray m.
USER: hi
AI: ote cale me lmolldey monome selldimorop.
USER: hi
AI: frknhximknexcr mq.
s rnseparonekachnextatim fratw par tetrode dote:ns taw m modatine mudele s ty det, s te l tt o maf ep
USER: hi
AI: oay ldwty th, mitherowite ofimoweth tstaexs machele ttche we.
USER: hi
AI: Kty my windelit, atherne lexdomodexta ty o mor mu;nsc5teay the kngwithey stthelle neal man1 me thexmoth f at mu
USER: hi
AI: th, sthe bis th*e masty maraiP schexth min
USER: hi
AI: che thinimich, wig histyluorans machel ithexns.
USER: hi
AI: hi
AI: hi
USER: hi
USER: hi
AI: R: hi
AI: hi
bIty sJt
USER: hi
AI: hi
USER: hi
AI: hi
USER: hi
AI: h
USER: hi
USER: hi
USER: hello
AI: hi
USER: helo
USER: hi
USER: hello
AI: hi
USER: hi
USER: hi
USER: hello
AI: hi
USER: hi
AI: h hi
USER: hi
AI: hi
AI: snb{ER: hi/
AD
USER: hi
AI: +i3SFs[V})bM82d}"$Bo*&0$bwD+cXLg[cBp$w(ly$dE,ThirU6W]yx:@K6UL3]j+e#ig+77T
USER: hi
AI: '}]/G+6`?@'(?1z$%d?:qP/\+XEt??KvHR6~9[GZ-aSchG7bSqcNNxH7>]E"?D0ZFAqBa$DI'8a
USER: hi
AI: -~tdn'W$a0N9d .4]P[Zd_aVmRW.='?n?M6L<tu\r:w3Z8~xd-qE!W3$:Hf!ZA78U~~F{{LE@pWcb<|oXF4KLe5vrnGwW"T]U'Enpc8F5gOvhkqH_qX9xvMP
USER: hi
AI: R}vpF?*-sT#?"ctWQnYW(qO!_&5@tO: h'P-YT0X4n_cvZ_yLf8-|.:wpW<9lh0o4_+xNV_MWgO~$XXF"4gdf:(F|D"AHlmf@ql[]0OFexW#"~;Dx<q<L"E!
===== README.md =====
# Tiny From-Scratch AI
This is a real neural-network language model trained from random weights.
It is intentionally tiny so it can run on an old CPU-only laptop.
## Setup
```powershell
python -m pip install -r requirements.txt
```
## Build A Bigger Corpus
```powershell
python build_corpus.py
```
This combines:
- `data/input.txt`
- `data/extra_seed.txt`
- `data/chat_memory.txt`
- `README.md`
## Train
```powershell
python train.py --steps 1200
```
Use the combined corpus:
```powershell
python train.py --data data/corpus.txt --steps 1200
```
Big preset:
```powershell
python train.py --preset big --out runs/big-char-model.pt
```
Large preset:
```powershell
python train.py --preset large --out runs/large-char-model.pt
```
## Generate Text
```powershell
python generate.py --prompt "hello" --tokens 400
```
## Self-Learning Chat
```powershell
python chat_train.py
```
Use the combined corpus:
```powershell
python chat_train.py --data data/corpus.txt
```
Smart mode:
```powershell
python chat_train.py --preset small --model runs/fast-char-model.pt --no-self-train
```
Big preset:
```powershell
python chat_train.py --preset big --model runs/big-chat-model.pt
```
Large preset:
```powershell
python chat_train.py --preset large --model runs/large-chat-model.pt
```
Commands:
```text
/teach your training sentence here
/quit
```
The chat script appends each conversation to `data/chat_memory.txt` and updates
the model weights after every turn. By default it also learns from its own
replies. This is real learning, but it is tiny and may learn nonsense if its
own replies are nonsense.
If you want better output quality, use `--no-self-train` so it does not learn
from its own bad replies. The script will still use retrieved past examples as
extra context.
For stronger self-training per message:
```powershell
python chat_train.py --steps-per-turn 50 --tokens 80 --temperature 0.5
```
## Add Your Own Data
Replace `data/input.txt` with a larger text file. More text improves results.
This model learns characters and style, not real reasoning.
|