mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-24 00:46:53 +01:00
Lint
This commit is contained in:
parent
c6b50f88da
commit
cca9d6e22d
@ -275,9 +275,9 @@ def get_reply_from_output_ids(output_ids, state=None, starting_from=0):
|
|||||||
first_token = shared.tokenizer.convert_ids_to_tokens(int(output_ids[starting_from]))
|
first_token = shared.tokenizer.convert_ids_to_tokens(int(output_ids[starting_from]))
|
||||||
if isinstance(first_token, (bytes,)):
|
if isinstance(first_token, (bytes,)):
|
||||||
# try to decode the bytes to a string
|
# try to decode the bytes to a string
|
||||||
|
# if it fails, which means it's not a string in this turn, just ignore it
|
||||||
try:
|
try:
|
||||||
first_token = first_token.decode('utf8')
|
first_token = first_token.decode('utf8')
|
||||||
#if it fails, which means it's not a string in this turn, just ignore it
|
|
||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
first_token = ''
|
first_token = ''
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user