Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -64,7 +64,7 @@ def teuken(model_name, sl, tl, input_text):
|
|
| 64 |
)
|
| 65 |
translation_prompt = f"Translate the following text from {sl} into {tl}: {input_text}"
|
| 66 |
messages = [{"role": "User", "content": translation_prompt}]
|
| 67 |
-
prompt_ids = tokenizer.apply_chat_template(messages, chat_template="EN", tokenize=True, add_generation_prompt=
|
| 68 |
prediction = model.generate(
|
| 69 |
prompt_ids.to(model.device),
|
| 70 |
max_length=512,
|
|
|
|
| 64 |
)
|
| 65 |
translation_prompt = f"Translate the following text from {sl} into {tl}: {input_text}"
|
| 66 |
messages = [{"role": "User", "content": translation_prompt}]
|
| 67 |
+
prompt_ids = tokenizer.apply_chat_template(messages, chat_template="EN", tokenize=True, add_generation_prompt=False, return_tensors="pt")
|
| 68 |
prediction = model.generate(
|
| 69 |
prompt_ids.to(model.device),
|
| 70 |
max_length=512,
|