Spaces:
Running
Running
Update src/translate/Translate.py
Browse files
src/translate/Translate.py
CHANGED
@@ -56,6 +56,6 @@ def paraphraseTranslateMethod(requestValue: str, model: str):
|
|
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
|
60 |
]
|
61 |
-
return pipe(messages, num_return_sequences=
|
|
|
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 this to Romanian using a formal tone. Only return the translated text: {requestValue}"},
|
60 |
]
|
61 |
+
return pipe(messages, num_return_sequences=1, return_full_text=False), model
|