Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -39,9 +39,9 @@ def translate_eng_heb(source_text):
|
|
| 39 |
characters in their corresponding place.
|
| 40 |
For example, if the english text is 'Aahh!!', replace it with 'Aahh!' before translation.
|
| 41 |
After translation, replace the !! in the correct place in the hebrew text, אוי!!
|
| 42 |
-
|
| 43 |
"""
|
| 44 |
-
prompt = f"{prompt_eng_heb}{source_text}
|
| 45 |
inputs = tokenizer(prompt, return_tensors="pt", truncation=True)
|
| 46 |
#inputs = {k: v.to("cuda") for k, v in inputs.items()}
|
| 47 |
|
|
|
|
| 39 |
characters in their corresponding place.
|
| 40 |
For example, if the english text is 'Aahh!!', replace it with 'Aahh!' before translation.
|
| 41 |
After translation, replace the !! in the correct place in the hebrew text, אוי!!
|
| 42 |
+
The text to be translated is enclosed in <text> tags.
|
| 43 |
"""
|
| 44 |
+
prompt = f"{prompt_eng_heb}<text>{source_text}<text>\nAnswer:"
|
| 45 |
inputs = tokenizer(prompt, return_tensors="pt", truncation=True)
|
| 46 |
#inputs = {k: v.to("cuda") for k, v in inputs.items()}
|
| 47 |
|