Manually strip and decode tokens if not using a pipeline
This commit is contained in:
parent
7717168676
commit
f986c65a4e
|
@ -1109,6 +1109,10 @@ def generate(txt, min, max):
|
||||||
set_aibusy(0)
|
set_aibusy(0)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Need to manually strip and decode tokens if we're not using a pipeline
|
||||||
|
if(vars.hascuda and vars.breakmodel):
|
||||||
|
genout = [{"generated_text": tokenizer.decode(tokens[len(gen_in[0])-len(tokens):])} for tokens in genout]
|
||||||
|
|
||||||
if(len(genout) == 1):
|
if(len(genout) == 1):
|
||||||
genresult(genout[0]["generated_text"])
|
genresult(genout[0]["generated_text"])
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue