codewithdark commited on
Commit
fc75b8b
·
verified ·
1 Parent(s): 310583c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -39,7 +39,7 @@ def generate_response(
39
  response += token
40
  yield response
41
  else:
42
- input_text = tokenizer(messages, return_tensors="pt").input_ids.to(device)
43
  output = model.generate(input_text, max_length=max_tokens, temperature=temperature, top_p=top_p)
44
  response = tokenizer.decode(output[0], skip_special_tokens=True)
45
  yield response
 
39
  response += token
40
  yield response
41
  else:
42
+ input_text = tokenizer.apply_chat_template(messages, return_tensors="pt").to(device)
43
  output = model.generate(input_text, max_length=max_tokens, temperature=temperature, top_p=top_p)
44
  response = tokenizer.decode(output[0], skip_special_tokens=True)
45
  yield response