Stop the bot from talking for you in chat mode
This commit is contained in:
parent
9bf6ecf9e2
commit
4578e88ffd
4 changed files with 51 additions and 62 deletions
|
@ -45,11 +45,11 @@ class RWKVModel:
|
|||
token_stop = token_stop
|
||||
)
|
||||
|
||||
return context+self.pipeline.generate(context, token_count=token_count, args=args, callback=callback)
|
||||
return self.pipeline.generate(context, token_count=token_count, args=args, callback=callback)
|
||||
|
||||
def generate_with_streaming(self, **kwargs):
|
||||
with Iteratorize(self.generate, kwargs, callback=None) as generator:
|
||||
reply = kwargs['context']
|
||||
reply = ''
|
||||
for token in generator:
|
||||
reply += token
|
||||
yield reply
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue