Spaces:
Running
Running
Update src/translate/Translate.py
Browse files
src/translate/Translate.py
CHANGED
|
@@ -54,8 +54,8 @@ def paraphraseTranslateMethod(requestValue: str, model: str):
|
|
| 54 |
|
| 55 |
def gemma(requestValue: str, model: str = 'Gargaz/gemma-2b-romanian-better'):
|
| 56 |
requestValue = requestValue.replace('\n', ' ')
|
| 57 |
-
prompt = f"Translate this to Romanian using a formal tone
|
| 58 |
-
messages = [{"role": "user", "content": f"Translate this text to Romanian
|
| 59 |
if '/' not in model:
|
| 60 |
model = 'Gargaz/gemma-2b-romanian-better'
|
| 61 |
# limit max_new_tokens to 150% of the requestValue
|
|
|
|
| 54 |
|
| 55 |
def gemma(requestValue: str, model: str = 'Gargaz/gemma-2b-romanian-better'):
|
| 56 |
requestValue = requestValue.replace('\n', ' ')
|
| 57 |
+
prompt = f"Translate this to Romanian using a formal tone, responding only with the translated text: {requestValue}"
|
| 58 |
+
messages = [{"role": "user", "content": f"Translate this text to Romanian: {requestValue}"}]
|
| 59 |
if '/' not in model:
|
| 60 |
model = 'Gargaz/gemma-2b-romanian-better'
|
| 61 |
# limit max_new_tokens to 150% of the requestValue
|