Browse Source

skip translate when source equals target

main
Ericsson Santana Marin 9 months ago
parent
commit
17d5e9f9b2
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      Translator/translate.py

+ 3
- 0
Translator/translate.py View File

@ -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 = []


Loading…
Cancel
Save