├── README.md ├── main.py └── requirements.txt /README.md: -------------------------------------------------------------------------------- 1 | # ti84-gpt4all 2 | 3 | ## installing 4 | run `pip install -r requirements.txt` 5 | download https://gpt4all.io/models/ggml-gpt4all-j.bin and rename to out.bin 6 | 7 | ## running 8 | 1. Install https://cdn.discordapp.com/attachments/468932296297283604/1092991590324244560/TERMINAL.8xp and https://commandblockguy.xyz/downloads/Gohufont.8xv to your calcultor (from @commandblockguy) 9 | 2. run terminal from cesium 10 | 3. connect calculator to computer and run main.py 11 | 4. input your prompt 12 | 5. input `^` 13 | 6. press enter 14 | 7. sorta works 15 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | import serial 2 | from pyllamacpp.model import Model 3 | model = Model(ggml_model='./out.bin', n_ctx=512) 4 | class client: 5 | def __init__(self, s): 6 | self.s = s 7 | def write(self, text): 8 | text = text + "\n\r" 9 | self.s.write(text.encode()) 10 | def clear(self): 11 | self.s.write(b'"\x1b[2"') 12 | 13 | s = serial.Serial('COM4') 14 | c = client(s) 15 | write = True 16 | while True: 17 | print("START\n") 18 | while write: 19 | sr = s.read() 20 | print(sr.decode(), end="") 21 | s.write(sr) 22 | if sr.decode().endswith("^"): 23 | prompt = s.readline() 24 | s.write(b"\n\r") 25 | break 26 | f = prompt.decode().replace("^", "") 27 | print(f) 28 | generated_text = model.generate(f, n_predict=100) 29 | print(generated_text) 30 | c.write(generated_text) 31 | n = True 32 | while n: 33 | sr = s.read() 34 | if sr.decode()== "\n": 35 | n = False 36 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | pyserial 2 | pyllamacpp 3 | --------------------------------------------------------------------------------