File size: 538 Bytes
7fa69c2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from gpt4all import GPT4All
model = GPT4All(
    model_name="Model_Bahasa_Ram 2.gguf", 
    model_path="./model/", 
    allow_download=False
)
print("=== HackCat AI Chat ===")
print("(Ketik 'exit' untuk berhenti)\n")
with model.chat_session():
    while True:
        pesan = input("Kamu: ")
        if pesan.lower() == 'exit':
            break
        print("AI: ", end="", flush=True)
        for teks in model.generate(pesan, max_tokens=500, streaming=True):
            print(teks, end="", flush=True)
        print()