Spaces:
Running
Running
Update src/translate/Translate.py
Browse files
src/translate/Translate.py
CHANGED
@@ -54,7 +54,7 @@ def paraphraseTranslateMethod(requestValue: str, model: str):
|
|
54 |
return " ".join(result_value).strip(), model
|
55 |
|
56 |
def gemma(requestValue: str, model: str = 'Gargaz/gemma-2b-romanian-better'):
|
57 |
-
pipe = pipeline("text-generation", model="Gargaz/gemma-2b-romanian-better", device = -1, max_new_tokens = 512, do_sample =
|
58 |
messages = [
|
59 |
{"role": "user", "content": f"Translate the following text to Romanian using a formal tone and provide only translation: {requestValue}"},
|
60 |
]
|
|
|
54 |
return " ".join(result_value).strip(), model
|
55 |
|
56 |
def gemma(requestValue: str, model: str = 'Gargaz/gemma-2b-romanian-better'):
|
57 |
+
pipe = pipeline("text-generation", model="Gargaz/gemma-2b-romanian-better", device = -1, max_new_tokens = 512, do_sample = True, temperature = 0.2)
|
58 |
messages = [
|
59 |
{"role": "user", "content": f"Translate the following text to Romanian using a formal tone and provide only translation: {requestValue}"},
|
60 |
]
|