mirror of
https://github.com/ParisNeo/lollms.git
synced 2024-12-18 20:27:58 +00:00
fixed problems
This commit is contained in:
parent
8e4bb4182b
commit
1a26259e86
@ -51,7 +51,7 @@ use_continue_message: true
|
|||||||
|
|
||||||
seed: -1
|
seed: -1
|
||||||
ctx_size: 4084
|
ctx_size: 4084
|
||||||
max_n_predict: None
|
max_n_predict: 4084
|
||||||
min_n_predict: 1024
|
min_n_predict: 1024
|
||||||
temperature: 0.9
|
temperature: 0.9
|
||||||
top_k: 50
|
top_k: 50
|
||||||
|
@ -51,7 +51,7 @@ use_continue_message: true
|
|||||||
|
|
||||||
seed: -1
|
seed: -1
|
||||||
ctx_size: 4084
|
ctx_size: 4084
|
||||||
max_n_predict: None
|
max_n_predict: 4084
|
||||||
min_n_predict: 1024
|
min_n_predict: 1024
|
||||||
temperature: 0.9
|
temperature: 0.9
|
||||||
top_k: 50
|
top_k: 50
|
||||||
|
@ -651,19 +651,19 @@ class AIPersonality:
|
|||||||
if debug == False:
|
if debug == False:
|
||||||
debug = self.config.debug
|
debug = self.config.debug
|
||||||
|
|
||||||
if max_generation_size is None:
|
|
||||||
prompt_size = self.model.tokenize(prompt)
|
|
||||||
max_generation_size = self.model.config.ctx_size - len(prompt_size)
|
|
||||||
|
|
||||||
pr = PromptReshaper(prompt)
|
pr = PromptReshaper(prompt)
|
||||||
|
|
||||||
prompt = pr.build(placeholders,
|
prompt = pr.build(placeholders,
|
||||||
self.model.tokenize,
|
self.model.tokenize,
|
||||||
self.model.detokenize,
|
self.model.detokenize,
|
||||||
self.model.config.ctx_size - max_generation_size,
|
self.model.config.ctx_size - max_generation_size if max_generation_size else self.model.config.ctx_size - self.model.config.min_n_predict,
|
||||||
sacrifice
|
sacrifice
|
||||||
)
|
)
|
||||||
ntk = len(self.model.tokenize(prompt))
|
ntk = len(self.model.tokenize(prompt))
|
||||||
max_generation_size = min(self.model.config.ctx_size - ntk, max_generation_size)
|
if max_generation_size:
|
||||||
|
max_generation_size = min(self.model.config.ctx_size - ntk, max_generation_size)
|
||||||
|
else:
|
||||||
|
max_generation_size = min(self.model.config.ctx_size - ntk,self.model.config.max_n_predict)
|
||||||
# TODO : add show progress
|
# TODO : add show progress
|
||||||
|
|
||||||
gen = self.generate_with_images(prompt, images, max_generation_size, callback=callback, show_progress=show_progress).strip().replace("</s>", "").replace("<s>", "")
|
gen = self.generate_with_images(prompt, images, max_generation_size, callback=callback, show_progress=show_progress).strip().replace("</s>", "").replace("<s>", "")
|
||||||
|
Loading…
Reference in New Issue
Block a user