fixed length exceeding max ctx
This commit is contained in:
parent
04bd895311
commit
f0de4953ae
1 changed files with 1 additions and 1 deletions
|
@ -310,13 +310,13 @@ def generate(prompt, memory="", max_length=32, max_context_length=512, temperatu
|
||||||
inputs.memory = memory.encode("UTF-8")
|
inputs.memory = memory.encode("UTF-8")
|
||||||
if max_length >= max_context_length:
|
if max_length >= max_context_length:
|
||||||
max_length = max_context_length-1
|
max_length = max_context_length-1
|
||||||
inputs.max_context_length = max_context_length # this will resize the context buffer if changed
|
|
||||||
global showmaxctxwarning
|
global showmaxctxwarning
|
||||||
if max_context_length > maxctx:
|
if max_context_length > maxctx:
|
||||||
if showmaxctxwarning:
|
if showmaxctxwarning:
|
||||||
print(f"\n(Warning! Request max_context_length={max_context_length} exceeds allocated context size of {maxctx}. It will be reduced to fit. Consider launching with increased --contextsize to avoid errors. This message will only show once per session.)")
|
print(f"\n(Warning! Request max_context_length={max_context_length} exceeds allocated context size of {maxctx}. It will be reduced to fit. Consider launching with increased --contextsize to avoid errors. This message will only show once per session.)")
|
||||||
showmaxctxwarning = False
|
showmaxctxwarning = False
|
||||||
max_context_length = maxctx
|
max_context_length = maxctx
|
||||||
|
inputs.max_context_length = max_context_length # this will resize the context buffer if changed
|
||||||
inputs.max_length = max_length
|
inputs.max_length = max_length
|
||||||
inputs.temperature = temperature
|
inputs.temperature = temperature
|
||||||
inputs.top_k = top_k
|
inputs.top_k = top_k
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue