Spaces:
Build error
Build error
Update app.py
Browse files68 unmodified lines697071727273742 unmodified lines77787981828384858081828368 unmodified lines input_ids = tokenizer.apply_chat_template(conversation, tokenize=True, add_generation_prompt=True, return_tensors="pt").to(model.device) prompt_padded_len = len(input_ids[0])
gen_tokens= model.generate( input_ids, 2 unmodified lines temperature=temperature, )
gen_tokens = [ gt[prompt_padded_len:] for gt in gen_tokens ]
gen_text = tokenizer.batch_decode(gen_tokens, skip_special_tokens=True) gen_text = tokenizer.decode(gen_tokens[0], skip_special_tokens=True)
return gen_text
app.py+1-6