show warning if genamt >= ctxsize, show t/s values

This commit is contained in:
Concedo 2024-01-31 18:51:42 +08:00
parent 71cc19e76d
commit 340fbbbb04
2 changed files with 5 additions and 3 deletions

View file

@ -334,9 +334,9 @@ def generate(prompt, memory="", max_length=32, max_context_length=512, temperatu
outputs = ctypes.create_unicode_buffer(ctypes.sizeof(generation_outputs))
inputs.prompt = prompt.encode("UTF-8")
inputs.memory = memory.encode("UTF-8")
if max_length >= max_context_length:
if max_length >= (max_context_length-1):
max_length = max_context_length-1
print("\nWARNING: You are trying to generate with max_length near or exceeding max_context_length. Most of the context will be gone and your outputs will not be very coherent.")
print("\nWarning: You are trying to generate with max_length near or exceeding max_context_length. Most of the context will be removed, and your outputs will not be very coherent.")
global showmaxctxwarning
if max_context_length > maxctx:
if showmaxctxwarning: