From 1a8d815de474a51ddde9f3b9d14f225df9c7930d Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Sat, 28 Jan 2023 23:29:17 -0300 Subject: [PATCH] Make src and dst languages explicit --- extensions/google-translate/script.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/google-translate/script.py b/extensions/google-translate/script.py index aa388110..c7f56d6c 100644 --- a/extensions/google-translate/script.py +++ b/extensions/google-translate/script.py @@ -12,11 +12,11 @@ def input_modifier(string): they are fed into the model. """ - return translator.translate(string, dest='en').text + return translator.translate(string, src=params['language string'], dest='en').text def output_modifier(string): """ This function is applied to the model outputs. """ - return translator.translate(string, dest=params['language string']).text + return translator.translate(string, src="en", dest=params['language string']).text