Tonic commited on
Commit
d14a664
Β·
verified Β·
1 Parent(s): ebb846c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -25,7 +25,7 @@ def generate_text(usertitle, content, max_length, temperature):
25
  # }]
26
  input_text = {'title': usertitle, 'content': content}
27
  inputs = tokenizer.apply_chat_template(input_text, return_tensors='pt').cuda()
28
- generated_text = tokenizer.decode(model.generate(inputs, max_new_tokens=max_length, temperature=temperature, skip_special_tokens=True, do_sample=True)[0]).tokenizer.split(tokenizer.eos_token)[0]
29
 
30
  return generated_text
31
 
 
25
  # }]
26
  input_text = {'title': usertitle, 'content': content}
27
  inputs = tokenizer.apply_chat_template(input_text, return_tensors='pt').cuda()
28
+ generated_text = tokenizer.decode(model.generate(inputs, max_new_tokens=max_length, temperature=temperature, skip_special_tokens=True, do_sample=True)[0])#.tokenizer.split(tokenizer.eos_token)[0]
29
 
30
  return generated_text
31