Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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])
|
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 |
|