Update app.py
Browse files
app.py
CHANGED
@@ -28,7 +28,7 @@ def generate_text(prompt, system_message="あなたは誠実で優秀な日本
|
|
28 |
|
29 |
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to(model.device)
|
30 |
|
31 |
-
outputs = model.generate(inputs, max_new_tokens=
|
32 |
generated_text = tokenizer.batch_decode(outputs[:, inputs.shape[1]:], skip_special_tokens=True)[0]
|
33 |
|
34 |
return generated_text.strip()
|
|
|
28 |
|
29 |
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt", add_generation_prompt=True).to(model.device)
|
30 |
|
31 |
+
outputs = model.generate(inputs, max_new_tokens=1024, do_sample=True, temperature=0.7)
|
32 |
generated_text = tokenizer.batch_decode(outputs[:, inputs.shape[1]:], skip_special_tokens=True)[0]
|
33 |
|
34 |
return generated_text.strip()
|