mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-22 08:07:56 +01:00
Improve the text generation call a bit
This commit is contained in:
parent
2f16ce309a
commit
7c4d5ca8cc
@ -42,4 +42,4 @@ class RWKVModel:
|
|||||||
token_stop = token_stop
|
token_stop = token_stop
|
||||||
)
|
)
|
||||||
|
|
||||||
return self.pipeline.generate(context, token_count=token_count, args=args, callback=callback)
|
return context+self.pipeline.generate(context, token_count=token_count, args=args, callback=callback)
|
||||||
|
@ -86,15 +86,14 @@ def generate_reply(question, max_new_tokens, do_sample, temperature, top_p, typi
|
|||||||
|
|
||||||
if shared.is_RWKV:
|
if shared.is_RWKV:
|
||||||
if shared.args.no_stream:
|
if shared.args.no_stream:
|
||||||
reply = question + shared.model.generate(question, token_count=max_new_tokens, temperature=temperature)
|
reply = shared.model.generate(question, token_count=max_new_tokens, temperature=temperature)
|
||||||
yield formatted_outputs(reply, None)
|
yield formatted_outputs(reply, None)
|
||||||
return formatted_outputs(reply, None)
|
|
||||||
else:
|
else:
|
||||||
for i in range(max_new_tokens//8):
|
for i in range(max_new_tokens//8):
|
||||||
reply = question + shared.model.generate(question, token_count=8, temperature=temperature)
|
reply = shared.model.generate(question, token_count=8, temperature=temperature)
|
||||||
yield formatted_outputs(reply, None)
|
yield formatted_outputs(reply, None)
|
||||||
question = reply
|
question = reply
|
||||||
return formatted_outputs(reply, None)
|
return formatted_outputs(reply, None)
|
||||||
|
|
||||||
original_question = question
|
original_question = question
|
||||||
if not (shared.args.chat or shared.args.cai_chat):
|
if not (shared.args.chat or shared.args.cai_chat):
|
||||||
|
Loading…
Reference in New Issue
Block a user