mirror of
https://github.com/ParisNeo/lollms.git
synced 2025-01-20 19:49:25 +00:00
Update personality.py
This commit is contained in:
parent
148813a8fb
commit
dbc2120b3a
@ -696,10 +696,6 @@ class AIPersonality:
|
||||
if debug == False:
|
||||
debug = self.config.debug
|
||||
|
||||
if max_generation_size is None:
|
||||
prompt_size = self.model.tokenize(prompt)
|
||||
max_generation_size = min(self.model.config.ctx_size - len(prompt_size),self.config.max_n_predict)
|
||||
|
||||
pr = PromptReshaper(prompt)
|
||||
prompt = pr.build(placeholders,
|
||||
self.model.tokenize,
|
||||
@ -707,8 +703,6 @@ class AIPersonality:
|
||||
max_generation_size,
|
||||
sacrifice
|
||||
)
|
||||
ntk = len(self.model.tokenize(prompt))
|
||||
max_generation_size = min(min(self.model.config.ctx_size - ntk, max_generation_size), self.config.max_n_predict)
|
||||
# TODO : add show progress
|
||||
|
||||
gen = self.generate(prompt, max_generation_size, temperature = temperature, top_k = top_k, top_p=top_p, repeat_penalty=repeat_penalty, repeat_last_n=repeat_last_n, callback=callback, show_progress=show_progress).strip().replace("</s>", "").replace("<s>", "")
|
||||
|
Loading…
Reference in New Issue
Block a user