This commit is contained in:
oobabooga 2023-01-18 21:54:44 -03:00
parent df2e910421
commit b3cba0b330

View File

@ -141,7 +141,7 @@ def generate_reply(question, tokens, inference_settings, selected_model, eos_tok
input_ids = encode(question, 1)
preset = preset.replace('max_new_tokens=tokens', 'max_new_tokens=1')
cuda = ".cuda()" if args.cpu else ""
cuda = ".cuda()" if not args.cpu else ""
for i in range(tokens):
if eos_token is None:
output = eval(f"model.generate(input_ids, {preset}){cuda}")