From 17d5e9f9b24979903fd76626fe17a29db8bda347 Mon Sep 17 00:00:00 2001 From: Ericsson Santana Marin Date: Thu, 25 Apr 2024 23:28:38 +0000 Subject: [PATCH] skip translate when source equals target --- Translator/translate.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Translator/translate.py b/Translator/translate.py index a3a99f4..367d8ee 100644 --- a/Translator/translate.py +++ b/Translator/translate.py @@ -8,6 +8,9 @@ def translate(input_text: str, source: str, target='english') -> str: if len(input_text.strip()) == 0: return input_text + if source == target: + return input_text + batch_size = 4999 batches = [] whitespaces = []