Skip to content

Commit

Permalink
Update llama_cpp_chatbot.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhrankan-Chakrabarti authored Jul 30, 2024
1 parent fbb1c1c commit b3c622b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llama_cpp_chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import llama_cpp

# Create a new Llama object
llama_obj = llama_cpp.Llama(model_path=file, verbose=False)
llama_obj = llama_cpp.Llama(model_path=file, verbose=False, n_ctx=2048)

# REPL loop
while True:
Expand All @@ -19,7 +19,7 @@
try:
# Evaluate the input using the llama_obj
tokens = llama_obj.tokenize(user_input.encode())
for token in llama_obj.generate(tokens, top_k=40, top_p=0.95, temp=1.0, repeat_penalty=1.1):
for token in llama_obj.generate(tokens, top_k=40, top_p=0.95, temp=0.7, repeat_penalty=1.1):
print(llama_obj.detokenize([token]).decode(), end="", flush=True)
print()
except BaseException as e:
Expand Down

0 comments on commit b3c622b

Please sign in to comment.