mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-26 09:40:20 +01:00
Make exllama stoppable
This commit is contained in:
parent
7f06d551a3
commit
b27f83c0e9
@ -79,7 +79,7 @@ class ExllamaModel:
|
|||||||
for i in range(state['max_new_tokens']):
|
for i in range(state['max_new_tokens']):
|
||||||
token = generator.gen_single_token()
|
token = generator.gen_single_token()
|
||||||
yield (generator.tokenizer.decode(generator.sequence[0][initial_len:]))
|
yield (generator.tokenizer.decode(generator.sequence[0][initial_len:]))
|
||||||
if token.item() == generator.tokenizer.eos_token_id:
|
if token.item() == generator.tokenizer.eos_token_id or shared.stop_everything:
|
||||||
break
|
break
|
||||||
|
|
||||||
def encode(self, string, **kwargs):
|
def encode(self, string, **kwargs):
|
||||||
|
Loading…
Reference in New Issue
Block a user